Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tradovate Order handeling.

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

    Tradovate Order handeling.

    Hello There

    I have a strategy that runs OnEachTick, the strategy has two buttons, Long/Short
    If long is pressed and we are Flat it will submit a market order long and opposite for short.
    EnterLong(TradingContracts, "Long 0");


    OnExecutionUpdate i catch the entry and sets stop and target.
    TradingSLOrder = ExitLongStopMarket(0, true, Position.Quantity, TradingInitialSL,"Stop loss", "");
    TradingTPOrder = ExitLongLimit(0, true, Position.Quantity, TradingInitialTP + (TradingEntryTargetOffset * TickSize), "Profit target", "");


    This works great in SIM and on a Rithmic account.
    On Tradovate accounts i have a issue.

    When my target is hit it seems that some times it Re-Enters double as if tradovate does not enter market fast enough and then the strategy enters again on the next tick.


    Is there something different with tradovate compared to Rithmic and Sim account that makes it so i should do some differant checks.
    or is there something different in the way it executes orders or in the sequence it does the different things in. ?

    Donto
    NinjaTrader Ecosystem Vendor - otrading.dk

    #2
    Hello donto,

    With any brokerage there is flight time for order to be submitted, transmitted, accepted, become working, filled, and for that state to be reported back to the platform and for the position to change.
    Location will vary the transmission time.

    I would recommend using logic instead to prevent the second order.

    When the first order is submitted you could set a bool to true, to prevent the condition from evaluating as true again. Then when the position is exited set the bool back to false.

    You could also assign the order to a variable in OnOrderUpdate() and require the variable to be null to prevent the condition from evaluating as true again. When the exit order fills set the variable back to null.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea

      Thank you very much for the proposed solutions.
      I implemented the boolean and this imidiatley solved my issues.

      When creating a variable of type order you would implement it something like the example here ?.


      Donto
      NinjaTrader Ecosystem Vendor - otrading.dk

      Comment


        #4
        Hello donto,

        Yes, the 'NinjaScript > Language Reference > Strategy > Order'​ help guide page provides helpful sample code.
        Note, the order is being assigned from the order object provided by the parameter of OnOrderUpdate() (and not directly assigned from an order method call like EnterLong()).
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        52 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        48 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X