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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    64 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    22 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    25 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    52 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X