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 Karado58, 11-26-2012, 02:57 PM
      8 responses
      14,826 views
      0 likes
      Last Post Option Whisperer  
      Started by Option Whisperer, Today, 09:05 AM
      0 responses
      1 view
      0 likes
      Last Post Option Whisperer  
      Started by cre8able, Yesterday, 01:16 PM
      3 responses
      11 views
      0 likes
      Last Post cre8able  
      Started by Harry, 05-02-2018, 01:54 PM
      10 responses
      3,204 views
      0 likes
      Last Post tharton3  
      Started by ChartTourist, Today, 08:22 AM
      0 responses
      6 views
      0 likes
      Last Post ChartTourist  
      Working...
      X