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

Please, help me to join in my head WaitUntilFlat and GetRealtimeOrder()

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

    Please, help me to join in my head WaitUntilFlat and GetRealtimeOrder()

    Hello.

    Say, we have a strategy with start behaviour WaitUntilFlat.
    And, say, it State == State.Transition strategy has position and protective orders.

    Considering WaitUntilFlat, should strategy do GetRealtimeOrder() for the protective orders?

    if convert orders to realtime, strategy will have "virtual" position and real orders, right?
    And what will happen when a virtual position meets real order?

    I am strongly needed order in my head )

    Thanks in advance.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    GetRealtimeOrder is only used to transition orders which are currently active in historical data. If the protective orders are still active and they will be active in Realtime and need to be managed then you need to do that.

    This method is only needed if you have historical order references which you wish to transition and manage in real-time (i.e., you had a working order which was submitted historically and re-submitted in real-time as the strategy is enabled).
    https://ninjatrader.com/support/help...ub=getrealtime


    if convert orders to realtime, strategy will have "virtual" position and real orders, right?
    And what will happen when a virtual position meets real order?
    Your strategy always has a virtual position and the orders being real would depend on the start behavior. Wait until flat will compare the strategy position, in that case you would not have a flat position entering realtime so the orders would just be virtual until the strategy reaches flat. Once you are flat and also in realtime it could start placing real orders.

    If the Strategy Position is flat, then the Account Position and Strategy Position are assumed to be in sync with each other. The next order placed by your strategy would be placed as a live order to your account.

    If the Strategy Position is not flat, the strategy will place all trades in a "virtual" sense until the Strategy Position reaches or crosses a flat state. Once a flat state is achieved the Strategy Position will be assumed to be in sync with the Account Position and all future orders will be placed live.
    https://ninjatrader.com/support/help...#WaitUntilFlat


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      "the orders would just be virtual until the strategy reaches flat"
      Yahoo, the clarity came to me!
      Thanks a lot, Jesse!
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by helpwanted, Today, 03:06 AM
      1 response
      7 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      7 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      5 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      242 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      385 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X