• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Activate/Desactivate a strategy

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

    Activate/Desactivate a strategy

    Hello,

    Is possible to activate/desactivate a strategy from code? For example, when I start my Ninjatrader I would like that my strategies to be activated automaticly.

    Thanks and regards.

    #2
    Hello soyjesus,

    Thanks for your question.

    It is not possible to automatically enable strategies or schedule strategies for enablement.

    It would be technically possible through external tools. We could not provide any direction in this process, but this has been discussed by other members on the forums. I'll provide a link to a thread below.

    https://m.ninjatrader.com/support/fo...d.php?t=102531

    As for disabling, a strategy can disable itself with CloseStrategy(). If you wanted to have another NinjaScript disable the strategy, you will have to create an AddOn that will provide framework to have the strategies communicate with other NinjaScripts. An example that touches on this concept is also linked below.

    CloseStrategy() - https://ninjatrader.com/support/help...sestrategy.htm

    MySharedMethodsExample - https://ninjatrader.com/support/foru...104#post457104

    If there is anything else I can do to assist, please let me know.
    Last edited by NinjaTrader_Jim; 01-15-2018, 12:10 PM.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by harjinderjit, Today, 08:24 PM
    0 responses
    18 views
    0 likes
    Last Post harjinderjit  
    Started by Againmain1, Today, 03:04 AM
    1 response
    24 views
    1 like
    Last Post NinjaTrader_ShawnB  
    Started by jmahon, Yesterday, 11:44 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by Tomhgriff1, 01-03-2020, 04:07 AM
    4 responses
    50 views
    0 likes
    Last Post bkonia
    by bkonia
     
    Started by cary1267, Today, 09:37 AM
    1 response
    25 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Working...
    X