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 AaronKoRn, Today, 09:49 PM
    0 responses
    7 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Today, 08:42 PM
    0 responses
    9 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Today, 07:51 PM
    0 responses
    10 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,980 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Today, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X