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 Tim-c, Today, 03:54 AM
    0 responses
    3 views
    0 likes
    Last Post Tim-c
    by Tim-c
     
    Started by FrancisMorro, Today, 03:24 AM
    0 responses
    2 views
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,770 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    31 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    945 views
    0 likes
    Last Post spwizard  
    Working...
    X