Error with backtesting "Insufficent Funds"

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #117370 quote
    MajorBasse
    Participant
    Average

    Yesterday I ran a backtest with no complications whatsoever, today though I ran the same test and the backtest showed the “insufficent funds” icon on the equity curve.

    As you can clearly see on the picture below the funds are very much sufficent but the test stopped anyway. What has happened here?

    Volla-problem.png Volla-problem.png
    #117381 quote
    Nicolas
    Keymaster
    Master

    Funds are not sufficient to open more contracts, as it seems you are already on market with large amount by cumulating orders?

    #117383 quote
    MajorBasse
    Participant
    Average

    Hello Nicolas, I don´t think that´s the problem since I´ve set the maximum position size to a maximum of 4 contracts. And as you can see on the picture the system have been able to take 4 contracts previously without problem.

    #117385 quote
    Nicolas
    Keymaster
    Master

    Please give more information:

    • instrument
    • timeframe
    • code
    #117391 quote
    MajorBasse
    Participant
    Average

    Instrument: Sverige 30 Cash (20SK)

    Timeframe: 15 000 units 5M

    Code:

    //Regler
    MaximumContracts = 4
    TooManyContracts = abs(countofposition) >= MaximumContracts
    
    
    
    //Bollinger Indikator 1
    BandsPeriod=14
    BandsDeviation=1.25
    Chars= 100
    
    period = 200
    dev = 2
    data = customclose
    MA = average[period](data)
    BolUp = MA+STD[period]*dev
    BolDn = MA-STD[period]*dev
    
    if barindex>max(Chars,BandsPeriod) then
     
    Dev = std[BandsPeriod]*BandsDeviation
    Dev1 = square(Dev / Pointsize)
     
    temp=sqrt(average[chars](dev1))*pointsize
    if temp<>0 then
    temp=dev/temp
    endif
     
    if(temp>0) then
    iexp=Exp(-2*temp)
    returnNum= (1-iexp)/(1+iexp)
    osc= (returnNum)
    else
    iexp=Exp(2*temp)
    returnNum=(iexp-1)/(1+iexp)
    osc= (returnNum)
    endif
    endif
    
    
    
    //Variables
    Datum = 20200102
    NewYears = abs(Today)
    
    tma = TEMA[21]
    sma = Average[200]
    
    clow = low
    distansb = 1.0001
    tpl = 22
    tps = 26
    st = 10
    
    
    
    //Villkor
    if not (NewYears = Datum) then
    
    //Standard Long
    if osc > 0.985 and close>tma and close<BolDn and not TooManyContracts then
    buy 1 contracts at market
    set target pprofit tpl
    endif
    
    //Standard Short
    if osc > 0.985 and close<tma and close>BolUp and not TooManyContracts then
    sellshort 1 contracts at market
    set target pprofit tps
    endif
    
    
    
    //Exit Long
    if close crosses under sma then
    sell at market
    else
    if close crosses under BolDn then
    sell at market
    endif
    endif
    
    //Exit Short
    if close crosses over sma then
    exitshort at market
    else
    if close crosses over BolDn then
    exitshort at market
    else
    if (clow/sma) < distansb and close > open then
    exitshort at market
    endif
    endif
    endif
    endif
    
    
    
    //Money Management
    set stop ploss st
    
     
    
    #117396 quote
    Nicolas
    Keymaster
    Master

    Yes I have the same issue, and I can’t explain it now.. Funds are sufficient and equity is good, it should not behaves this way.. I’m asking PRT about that, please do it on your side by sending a tech report with the dedicated tool in the help section menu of the platform, and add the topic URL please.

    #117414 quote
    Nicolas
    Keymaster
    Master

    That issue is currently investigated, I’ll give news once I had some.

    #117416 quote
    MajorBasse
    Participant
    Average

    Thank you very much Nicolas. Now however it seems like the problem has resolved itself since the backtesting is working properly, but perhaps PRT would like to investigate anyway.

    #117419 quote
    GraHal
    Participant
    Master

    it seems like the problem has resolved itself

    Yes I tried well over 30 mins ago over 100K bars and my backtest wasn’t stopped.

    Maybe PRT fixed it after Nicolas prompted them?

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Error with backtesting "Insufficent Funds"


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
MajorBasse @majorbasse Participant
Summary

This topic contains 8 replies,
has 3 voices, and was last updated by GraHal
6 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/21/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...