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 Mindset, Today, 06:46 AM
    0 responses
    12 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, Yesterday, 05:21 PM
    0 responses
    19 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    16 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    82 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    50 views
    0 likes
    Last Post PaulMohn  
    Working...
    X