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 Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    8 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,792 views
    0 likes
    Last Post aligator  
    Working...
    X