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

Restarting Strategy, Starting Behavior

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

    Restarting Strategy, Starting Behavior

    After reading through the 4 strategy start behaviors I am still confused if any of them will work for my intended purpose or if I need to add new code to my strategy.

    If you look at my attachment for reference, I want the ability to freely turn on and off my strategy, and when I turn my strategy back on I would like it to place orders as if there were no historical bars to consider.

    For example I would like to turn off my strategy at 10 AM (first blue line) and then turn it back on at 11AM (second blue line). When I turn on my strategy at 11AM I would like it to immediately place new entries (Green Diamonds) and avoid waiting to be flat or trying to duplicate the entries that would have been made (Blue Diamonds) if the strategy had been running the whole time.

    Is this achieved with "immediately submit synchronize account?"

    Thank you

    Click image for larger version

Name:	Question.png
Views:	153
Size:	16.9 KB
ID:	1141138

    #2
    Hello mlprice12,

    Thanks for your post.

    Here is a link to a post by my colleague Chelsea where he details various options that may help your understanding: https://ninjatrader.com/support/foru...ion#post811541

    If you are looking for a code solution, what he advises is to test for State.Historical and return.

    If you are using the Strategy Builder, in each entry set you would need to add the condition of Misc>Current State, equals, Misc>State.Realtime (to create a "true" condition for the entry sets, meaning all historical bars are ignored)

    Please note that using either of these means there will be no historical trades (which means you cannot test in the strategy analyzer) and that the strategy will trade as soon as your entry conditions are true.

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul,

      I will use your link as guidance and post any questions that follow.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by zstheorist, Today, 07:52 PM
      0 responses
      3 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      149 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Working...
      X