Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Historical orders

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

    Historical orders

    Hi!
    Can you tell me please, is there any ability do not submit the historical orders, when I attach the strategy to a chart? In other way, I need start trading from "clean sheat". I don't care about the orders should placed before the time I attached a strategy to a chart! May be there is some options about that? I tried to clear all db and account information, but it didn't help.

    #2
    ilyats, you could just start your strategy OnBarUpdate() with

    if (Historical) return;
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertran, it works. But what to do with backtesting? There are no orders submitted in backtests if I use this code. Should I and one more extern bool variable to identify whether is the strategy is used in backtests or in real?

      Comment


        #4
        Correct, this would be realtime use only - another approach is removing the historical check and starting your strategy in 'WaitUntilFlat' mode - this would then take the first realtime generated signal and don't take into consideration any historically taken over orders / positions.

        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nleitman, Today, 11:46 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cmtjoancolmenero, Today, 01:09 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DanielRaz, Today, 12:54 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Russ Moreland, 04-24-2024, 12:54 PM
        2 responses
        17 views
        0 likes
        Last Post JosephDavidsona  
        Started by truepenny, Today, 03:45 AM
        5 responses
        27 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Working...
        X