Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

repeated strategy initialization

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

    repeated strategy initialization

    Hello,
    I would like to ask you if there is any possibility how to ensure only one run of the strategy. I mean that when I run the strategy and on the graph where the strategy is running I switch the timeframe or symbol then the strategy is initializing for the new conditions, i.e. for new timeframe or symbol.
    My strategy is strategy for only one order and the strategy will be disabled after the order closing. So I would like to be sure that the strategy will be running on the graf only once, i.e. any user mistakes such a timeframe switch will not starts new startegy...... how can I do it if it is possible???
    Thanks for your reply.
    Mira

    #2
    Hello Mira123456789,

    Thank you for your post.

    There would not be a means to detect this in NinjaScript. Each time the period type or value is changed the NinjaScript objects would be reloaded.
    Potentially you could write the instance and time frame to an external file and read that on start up of the strategy to detect what you are looking for. An example of reading and writing to an external file can be found at the following link: http://ninjatrader.com/support/forum...ead.php?t=3477

    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    27 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    117 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    226 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    414 views
    0 likes
    Last Post CaptainJack  
    Working...
    X