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

About MarketPosition in the Strategy at start

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

    About MarketPosition in the Strategy at start

    Hello

    I have a question about MarketPosition in the Strategy at start:
    The position will read either Long or Short before anything has even happened. As the strategy is start - it look at the bars that are loading in as everything is setting up and it "counting and trading on History" a few seconds of loading time.

    So even though I do NOT have an open position - Position.MarketPosition will insist I am either Long or Short and I see that Strategy have a some open position but in really Not have open positions. I understand that I can put condition for Ignore "State.Historical" BUT I would like to MOVE virtual Strategy positions in real opening position on the start of the Strategy.
    For example: If at start my Strategy show that in current time it have 3 Long positions - I would like to have Long position for 3 contracts (open positions by Market at the moment), not wait for next conditions for enter.​
    Last edited by vitaly_p; 03-24-2023, 06:06 AM.

    #2
    Read up on the two links here https://ninjatrader.com//support/hel...h_accounts.htm which address the difference between an historical backtesting position and your live account position, and how to synchronize between the two (or not) at the end of the historical period.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello vitaly_p,

      When you apply a strategy it will process all the historical bars first. During that time the strategy is doing a historical backtest so it can place virtual trades. If you don't want it to trade historically you would have to add as part of the conditions to enter a check for State.Realtime so it does not place historical trades.

      The position is a result of the strategies trading in both historical and realtime. If the strategy enters historical trades but does not exit them historically the default start behavior is to wait until the strategy exits those virtual trades and becomes flat. Once that happens it will begin working in realtime.

      You can review the start behaviors that are available in the following link to see which matches your trading style, the behavior Immediately submit, synchronize account would do what you are asking.

      •If the Account Position matches your Strategy Position, no reconciliatory order will be submitted. The strategy will then begin managing your Strategy Position immediately.

      •If the Account Position does not match your Strategy Position, NinjaTrader will submit a market order(s) to reconcile the Account Position to match your Strategy Position. The strategy will then begin managing your Strategy Position immediately.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Thank you Bruce and Thank you Jesse!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        5 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        13 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,982 views
        3 likes
        Last Post jhudas88  
        Working...
        X