crosses over and > < issue

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #161347 quote
    jayvee
    Participant
    Average

    Greetings all. I’m really confused as to what I’m doing wrong or if its a glitch. When you add ‘crosses over’ or the alternative method of using > and < in the code, the trades are not being executed in the backtest.  Part of the code is that there is an initial rise in the weekly candle (2 weeks ago) – for this I used a crossover of two ATR values. Its essentially pullback system.

    Using multitimeframe – 1 week with daily as default

    timeframe(1 week, updateonclose)
    atr2= averagetruerange[2](close)
    atr15= averagetruerange[15](close)
    
    timeframe(default)
    ....
    
    Bullish0 =atr2[2] crosses over atr15[2] and ....
    

    however this didnt work, so I tried

    timeframe(1 week, updateonclose)
    atr2= averagetruerange[2](close)
    atr15= averagetruerange[15](close)
    
    timeframe(default) .... 
    
    Bullish0 =(atr2[2]>atr15[2]) and (atr2[3]<atr15[3]) and ...
    

    And this doesnt work either.

    The trade does get executed if you take the above and remove the last bit ‘and (atr2[3]<atr15[3])’ – I have no idea why. But I need a ‘crosses over’ system rather than just being above the value

    Can someone help please?

    #161362 quote
    Vonasi
    Moderator
    Master

    Because you are checking the conditions in the daily time frame you are checking them two days back and not two weeks back. Move it to the weekly timeframe to check two weeks back.

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

crosses over and > < issue


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jayvee @jayvee Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Vonasi
5 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/13/2021
Status: Active
Attachments: No files
Logo Logo
Loading...