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

New to strategies, need some insight

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

    New to strategies, need some insight

    Hello all,

    I am just getting into strategies with the strategy builder. I have a few that are "working" but am running into an issue. Is there a way to "kill" a strategy until the opposite is true? Ie. Lets say for simplicity sake that I am running a simple PSAR strategy that triggers a buy when price is above and sell when below. Using a simple 20 tick TP and a 10 tick SL. Im running on various bars and time frames, my issue is that it keeps kicking off, multiple times back to back. I would like to be able to have the strat "wait" until the opposite is true before getting back in.

    For example, if trade 1 is a long trade then I wouldnt want to take another until it goes short. Sort of a reset. Is this possible within the builder? I am not very good with C# and would rather be able to use the builder to implement and adjust.

    Thanks in advance

    #2
    Hello sprks7979,

    Welcome to the NinjaTrader forums!

    You can use a bool variable for this. Once the first condition is true, set the bool to true in the 'Do the following section'. In that same condition set, require that bool to be false. This will mean once the action is taken, it won't be taken again until the bool is set back to false.

    In another condition with the opposite conditions, require this bool to be true, and set the bool back to false. This resets the trigger for the first condition set.

    Below is a link to an example of using bools that can be opened in the Strategy Builder.
    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
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by aligator, 01-06-2022, 12:14 PM
    4 responses
    233 views
    0 likes
    Last Post john_44573  
    Started by reynoldsn, Today, 05:56 PM
    0 responses
    4 views
    0 likes
    Last Post reynoldsn  
    Started by bortz, 11-06-2023, 08:04 AM
    51 responses
    1,989 views
    0 likes
    Last Post aligator  
    Started by dmking, 11-12-2019, 12:31 PM
    4 responses
    4,150 views
    0 likes
    Last Post jasonw
    by jasonw
     
    Started by roblogic, Today, 04:31 PM
    0 responses
    10 views
    0 likes
    Last Post roblogic  
    Working...
    X