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

Once conditions are met, enter once until they are met again.

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

    Once conditions are met, enter once until they are met again.

    Hi!, I have a problem that I thought it was a simple one but I can't manage to find a solution.
    With the strategy builder I made a strategy that basically has to go long when the price goes over the EMA envelope, then comes back, touches the EMA and closes above of the previous candle close.. Those are the conditions. I also add profit target and stop loss.
    The problem I encounter, is that it keeps re entering once the stop or the target has been reached. I don't want that, I want it to re enter a trade once the conditions process repeat.
    In other words, once the conditions happen, I want it to enter only once, until the conditions happen again.

    I read that maybe bool is the answer, but I don't know exactly how I should apply it.

    I'll appreciate any help, thanks!

    #2
    Hello, thanks for writing in.

    Our colleague made this example that might be useful for you:
    Hi, To improve a strategy, I would like the condition to enter a trade to be triggered only after a second crossing happens. Meaning, for instance we have a sthocastics crossing, but the strategy would only trigger when a crossing between 2 emas happen. Would the looking back N bars work? Can it be done within the builder


    This example steps two conditions to make them happen one after the other one. I also have an example attached showing how to perform just one entry per bar in the builder:

    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by yertle, 04-18-2024, 08:38 AM
    9 responses
    40 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    9 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,615 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Yesterday, 05:56 PM
    0 responses
    10 views
    0 likes
    Last Post jaybedreamin  
    Working...
    X