Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can the strategy be used for real trading?

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

    Can the strategy be used for real trading?

    When running strategy in demo account, for example running SampleMACrossOver strategy which exists after installing NinjaTrader, it suddenly create a lot of orders which trade for history bars. It's good because it can be used for back test. But can the strategy be used for real trading? For real trading, i don't want to create any orders for history bars, only want to create order for incoming new bar or new tick. How can i know it's new bar incoming or the history bars which just need to paint when getting OnBarUpdate() call? Thanks.

    #2
    Hello 51friend,

    You can add a statement to OnBarUpdate() that will allow the strategy to only run on live data.

    if (Historical)
    return;

    Clicking the link above will show you where this needs to go in the code. You cannot make changes to system strategies, but you can save a copy and modify from there. Click tools > Edit NinjaScript > Strategy > SampleMACrossover. Then Right Click and Select Save As to save a copy and make changes.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    60 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    145 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    283 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X