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 Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,768 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    10 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    7 views
    0 likes
    Last Post rocketman7  
    Working...
    X