Indicator not returning the same value when used in a strategy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #168267 quote
    Mattias
    Participant
    Senior

    Sorry if this is a frequently asked question, I tried to search but couldn’t find the answer.

    So if I for example do the following line in a indicator and in a strategy, and output the result,

    myATR = AverageTrueRange[14](close)

    I don’t get the same value in my indicator as outputted in my strategy with the graph command.

    However, if I do an average,

    myMA = Average[20](close)

    and output it as above, I do get the same value in the indicator as in my strategy. Why is this?

     

    Thanks!

    #168268 quote
    robertogozzi
    Moderator
    Master

    I am returned the same values, both for ATR and SMA, using these snippets:

    Avg = Average[10](close)
    buy at -close limit      //does nothing but preventing an error message
    graph Avg
    myATR = AverageTrueRange[14](close)
    buy at -close limit      //does nothing but preventing an error message
    graph myATR

    there can be some negligible differences, at times, due most likely to different rounding procedures, but they should not affect strategies.

    Mattias thanked this post
    x1.jpg x1.jpg x2.jpg x2.jpg xDifference.jpg xDifference.jpg
    #168274 quote
    Nicolas
    Keymaster
    Master

    Make sure you are not using custom trading hours on the current chart and with weekend data enabled.

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

Indicator not returning the same value when used in a strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Mattias @mattias Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/28/2021
Status: Active
Attachments: 3 files
Logo Logo
Loading...