Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Force error to cluse Strategy

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

    Force error to cluse Strategy

    Hi, I want to disable a strategy which reach certain conditions. I tried CloseStrategy() but it is not working, so the backup approach is to force an error which pass the compilation but triggers on that condition, tried to assign decimal value to an int but the compilator catch this.... any suggestion on other error I could use for this?

    Thanks, Marcelo

    PS: where it says "cluse" should say close
    Last edited by lordvader34; 04-12-2020, 05:23 PM.

    #2
    Hello Marcelo,

    CloseStrategy() is supposed to disable the strategy but only works in real-time. I tested this and it worked correctly on my end.


    I call it in OnBarUpdate() and it immediately disables the strategy.

    Does this strategy not disable in real-time on your end?
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, Yesterday, 09:41 PM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, Today, 02:41 AM
    0 responses
    6 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, Yesterday, 11:44 PM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    32 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    31 views
    0 likes
    Last Post CarlTrading  
    Working...
    X