Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Crosses Over doesn't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Crosses Over doesn't work

    I must be stupid be I cannot get even a simple strategy to work correctly.

    I have the properties to set to calculate on 'price change'. I simply want to enter long as soon as the price of the current candle breaks the high off the previous candle.

    If I set the condition to 'high/ask/close' of period 0 'crosses above' the high of period 1, then the strategy produces 0 results. So I must be doing something wrong.

    I can get some results if I set the condition to 'high' of period 0 is 'greater than' the 'high' of period 1. But I assume this will constantly trigger a trade every time the price changes and this isn't correct.

    I only want the trade to trigger once the high is broken once. I don't want it to keep triggering. I'm unsure what to do.


    #2
    I can answer my own question.

    I found a forum post that suggest to use a variable to check if the entry bar was the same as a the currentBar to make sure the trade isn't triggered multiple times.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by MatthewLesko, 05-21-2021, 09:37 PM
    4 responses
    164 views
    0 likes
    Last Post Mahmad1323  
    Started by samish18, Today, 03:02 PM
    3 responses
    15 views
    0 likes
    Last Post bltdavid  
    Started by Jakub, Today, 11:06 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by samish18, Today, 03:50 AM
    10 responses
    19 views
    0 likes
    Last Post samish18  
    Started by Mestor, 06-03-2018, 10:09 AM
    16 responses
    2,872 views
    0 likes
    Last Post myaha1000  
    Working...
    X