Difference between indicator and strategy

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #75906 quote
    allmycrudgm
    Participant
    New

    Hi

    What’s the differene between running a backtest and an indicator, i.e. should the ohlc be the same?

    I get different values between them on a tick chart. The indicator agrees with the chart but the graph function in the backtest has a different value, for ohlc. Can you explain why?

    Thanks

    Background info:

    indicator:__Indicator_ohlc

    return open as "open", high as "high", low as "low", close as "close"

     

    test:__strategry_ohlc

    // Conditions to enter long positions
    c1=0
    IF c1 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    
    graph open as "open"
    graph high as "high"
    graph low as "low"
    graph close as "close"
    
    
    diff.jpg diff.jpg
    #75911 quote
    Vonasi
    Moderator
    Master

    Welcome to the forums. Please use the ‘Insert PRT Code’ button when putting code in your posts to make it more readable. I have tidied up your post for you on this occasion. 🙂

    #75913 quote
    Vonasi
    Moderator
    Master

    Your image is confusing the question as it appears to show identical values! The answer to your question might be because an indicator is showing the values of a still forming bar or candle and the GRAPH function in a strategy will be the values of the last closed bar or candle.

    #75914 quote
    allmycrudgm
    Participant
    New

    Hi,

    Thanks for the reply and tidy up,

    You are correct, it is true, the last values are the same, however, can you explain why the graphs are different?

    Many Thanks

    #75915 quote
    Nicolas
    Keymaster
    Master

    Do you got the same behavior in other timeframe than the “tick by tick” one?

    #75917 quote
    allmycrudgm
    Participant
    New

    Yes, on the 1 second for example.

    #75919 quote
    Nicolas
    Keymaster
    Master

    Are you sure? Because I can replicate the same as you for the tick by tick chart but not in the 1 second chart where OHLC is the same. Please note that there are a lot of candlesticks that don’t exist on a 1 second timeframe if no ticks are received from the market.

    For the tick by tick chart, I think the differences come from when the system is evaluated or not (code read and executed) .. but I can’t be sure, I’ll try to get a definitive answer for this. Bear in mind, that there are no OHLC values with a 1 tick chart, but only one price.

    #75920 quote
    allmycrudgm
    Participant
    New

    Hi,

    Ok thanks. I posted the 1 seocnd chart, it looks the same, except the last three data points are not displayed on the backtest graph.

    Cheers

    Nigel

    1second.jpg 1second.jpg
    #76265 quote
    allmycrudgm
    Participant
    New

    Any news on this? Thanks

    #76269 quote
    Vonasi
    Moderator
    Master

    When you say last three you really mean last one. There were no trades for 14:42:51 and 14:42:52 but trades for 14:42:53. The backtest will not show this until that candle is closed and a new one opened. The indicator will show ‘on the fly’ so has a result to show you.

    #76338 quote
    allmycrudgm
    Participant
    New

    Hi,

    That does make sense, so I can accept that. Cheers.

    However, do you have any news regarding the original question?

    Thanks

    #76919 quote
    allmycrudgm
    Participant
    New

    Any update on this?

    Thanks

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

Difference between indicator and strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 11 replies,
has 3 voices, and was last updated by allmycrudgm
7 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/13/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...