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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    63 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    54 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    61 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    48 views
    0 likes
    Last Post CarlTrading  
    Working...
    X