Please, remind me how backest works on v10 and v11

Viewing 15 posts - 1 through 15 (of 32 total)
  • Author
    Posts
  • #112004 quote
    pieroim
    Participant
    Average

    if I remember correctly, it does not work tick by tick but considers the 4 main prices (OCHL) for each candle.

    What I do not remember is whether the backtester does the entry on the current candle by analyzing the previous candle, therefore knowing the 4 main prices of the previous candle + the opening price of the current candle, or knowing only the prices of the previous candle and ignoring the opening price of the current candle.

    Or the entrance does it at the closing of the current candle when the 4 main prices of it are known..

    Please let me know if there are any differences between v10 and v11 in this calculation.

    Thank’s

    Piero

    #112013 quote
    pieroim
    Participant
    Average

    Here I have this strange result of this simple trading system done just for testing the backtesting capability of Prorealtime.

    It seems that the backtester almost always sees the Blue > Red .. which is not true..

    Defparam cumulateorders=false
    
    if Barindex < 2 then
    BU = Close
    else
    BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
    endif
    
    if barindex>PP then
    Signal = BU
    Noise = Close
    SigmaSignal = STD[PP](Signal)
    SigmaNoise = STD[PP](Noise)
    a = SigmaSignal/SigmaNoise
    n = (2/a)-1
    
    if n < 1 then
    nn = 1
    else
    nn = n
    endif
    
    MB = ExponentialAverage[nn](Close)
    endif
    
    cl=(MB>BU)
    cs=(MB<BU)
    
    GRAPH cl coloured (0,0,255) as "cl"
    GRAPH cs coloured (255,0,0) as "cs"
    
    if NOT LongOnMarket AND cl THEN
    BUY 1 CONTRACTS AT MARKET
    endif
    
    if NOT ShortOnMarket AND cs THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    endif
    proreal-str.jpg proreal-str.jpg
    #112015 quote
    robertogozzi
    Moderator
    Master

    I moved your topic to ProOrder, since it’s not related to indicators.

    Tick-by-Tick mode is a built-in feature on v11.

    The CURRENT candle (in strategies) is ALWAYS the last closed CANDLE, since all strategies are executed when a candle closes and BEFORE the new one opens, so the opening price of the new candle is not known. This won’t change in v11.

    To access candles while they are being built you can only resort to MTF (Multiple Time Frame) support that lets you use a lower TF to access a higher TF candle while being built.

    #112016 quote
    robertogozzi
    Moderator
    Master

    Data shown in the variable window are related to the bar where the mouse sits at that very moment.

    Of course one of the two variables is false when the other one is true! (how can they be both either true or false at the same time?)

    Browse all candlesticks with your mouse and those values will change.

    #112017 quote
    pieroim
    Participant
    Average

    Ok Roberto,

    I moved your topic to ProOrder, since it’s not related to indicators.

    Tick-by-Tick mode is a built-in feature on v11.

    The CURRENT candle (in strategies) is ALWAYS the last closed CANDLE, since all strategies are executed when a candle closes and BEFORE the new one opens, so the opening price of the new candle is not known. This won’t change in v11.

    To access candles while they are being built you can only resort to MTF (Multiple Time Frame) support that lets you use a lower TF to access a higher TF candle while being built.

    ok Roberto, I too remembered what you say .. but this does not explain the behavior of the attached example .. there is something that still lack

    #112018 quote
    pieroim
    Participant
    Average

    the mouse pointer was there by accident, now I attach a picture with the pointer to a discrepancy

    proreal-str1.jpg proreal-str1.jpg
    #112020 quote
    robertogozzi
    Moderator
    Master

    Please attach the indicator or post a link to  it, in order to replicate your trades.

    Moreover, please post what isnstrument and TF (Daily?) you are working on.

    #112022 quote
    pieroim
    Participant
    Average

    Mini NASDAQ Full1219 daily

    if Barindex < 2 then
    BU = Close
    else
    BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
    endif
    
    if barindex>PP then
    Signal = BU
    Noise = Close
    SigmaSignal = STD[PP](Signal)
    SigmaNoise = STD[PP](Noise)
    a = SigmaSignal/SigmaNoise
    n = (2/a)-1
    
    if n < 1 then
    nn = 1
    else
    nn = n
    endif
    
    MB = ExponentialAverage[nn](Close)
    endif
    
    Return MB COLOURED(0,0,250) as "Meyer-Butterworth"
    if Barindex < 2 then
    BU = Close
    else
    BU = BU[1]-(BU[2]/3.414)+((1/3.414)*Close)
    endif
    
    RETURN BU COLOURED(250,0,0) as "Butterworth"
    
    #112023 quote
    pieroim
    Participant
    Average

    PP=17…

    #112050 quote
    robertogozzi
    Moderator
    Master

    You are using customized tradng hours, thus from Sept. 20th through Sept. 24th you only see 3 candlesticks, while there are 4, tallying sunday.

    Despite you won’t see some candlesticks on yur screen when customizing trading hours, they are still used to compute Indicators, because they represent price movements and cannot be ignored.

    I did use them long ago, but I resorted to default trading hours to be able to run/backtest strategies correctly.

    x-3.jpg x-3.jpg
    #112059 quote
    pieroim
    Participant
    Average

    I have changed instrument and time, but it still has the same mistakes..

    proreal-str2.jpg proreal-str2.jpg proreal-str3.jpg proreal-str3.jpg
    #112064 quote
    pieroim
    Participant
    Average

    I found out where is the problem, it’s in the calculation! But I just can’t explain why the calculation is wrong.

    It is the same of the indicators.

    Otherwise, is there a way to take the values calculated by the indicators without recalculating them in the trading system?

    proreal-str4.jpg proreal-str4.jpg
    #112073 quote
    robertogozzi
    Moderator
    Master

    Yes, you can use CALL to call an existing indicator and use the returned value(s).

    #112104 quote
    pieroim
    Participant
    Average

    Nothing.. with the CALL I have the identical wrong results.. this is the code:

    Defparam cumulateorders=false
    
    //if Barindex < 2 then
    //BU = Close
    //else
    //BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
    //endif
    
    BU = CALl "BUTTERWORTH"
    
    
    //if barindex>PP then
    //Signal = BU
    //Noise = Close
    //SigmaSignal = STD[PP](Signal)
    //SigmaNoise = STD[PP](Noise)
    //a = SigmaSignal/SigmaNoise
    //n = (2/a)-1
    
    //if n < 1 then
    //nn = 1
    //else
    //nn = n
    //endif
    
    //MB = ExponentialAverage[nn](Close)
    //endif
    
    MB = CALL "MAYER-BUTTERWORTH"[17]
    
    cl=(MB>BU)
    cs=(MB<BU)
    
    GRAPH MB coloured (0,0,255) as "cl"
    GRAPH BU coloured (255,0,0) as "cs"
    
    if NOT LongOnMarket AND cl THEN
    BUY 1 CONTRACTS AT MARKET
    endif
    
    if NOT ShortOnMarket AND cs THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    endif
    

    I don’t know what else to try.. for me both the previous code and the current one with CALLs are correct, I hope Nicolas can find a solution, the results of the backtest are completely useless on any strategy. I don’t know if it’s a problem with version 11, with the 10 I’ve never had these problems.

    proreal-str5.jpg proreal-str5.jpg
    #112113 quote
    Vonasi
    Moderator
    Master

    I have changed instrument and time

    What do you mean by changed time? Roberto is suggesting that you are using custom trading hours where candles are missing from your chart but are still used in indicator calculation If you have just switched to a different time frame then this is not what he meant.

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

Please, remind me how backest works on v10 and v11


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
pieroim @pieroim Participant
Summary

This topic contains 31 replies,
has 4 voices, and was last updated by Nicolas
6 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/04/2019
Status: Active
Attachments: 12 files
Logo Logo
Loading...