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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    156 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    74 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X