Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to make stategy position flat pragmatically?

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

    How to make stategy position flat pragmatically?

    Hi,
    Is there any way to make strategy position flat pragmatically?
    The strategy I have always goes to yellow color and doesn't execute the live orders.
    Is there any way I can force strategy pragmatically to ignore any historical order/state and set the position to flat and start the live orders?

    #2
    Hello rahulkalgunde,

    Yes, you can add the following line to OnBarUpdate() which means the strategy is only run against real-time data.

    if (Historical)
    return;
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Haiasi, 04-25-2024, 06:53 PM
    2 responses
    16 views
    0 likes
    Last Post Massinisa  
    Started by Creamers, Today, 05:32 AM
    0 responses
    4 views
    0 likes
    Last Post Creamers  
    Started by Segwin, 05-07-2018, 02:15 PM
    12 responses
    1,785 views
    0 likes
    Last Post Leafcutter  
    Started by poplagelu, Today, 05:00 AM
    0 responses
    3 views
    0 likes
    Last Post poplagelu  
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,407 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Working...
    X