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

Fill limit orders on touch => realtime equivalent

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

    Fill limit orders on touch => realtime equivalent

    I am running a strategy in realtime and would like to to mimic the equivalent of the 'Fill Limit Orders on touch' functionality in backtesting in realtime.

    Currently the strategy uses the following statements in configure to set stop/targets.


    SetStopLoss(CalculationMode.Ticks, StopTicks);
    SetProfitTarget(CalculationMode.Ticks, ProfitTicks);

    Would I need to use more explicit order management such as the following (in OnExecutionUpdate) so that a position is exited as soon as a price is'touched' when the strategy is running in realtime simulation mode?

    _profitOrder = ExitLongLimit(0, true, _posSize, _profit, ProfitLong, EnterLongName);
    _stopOrder = ExitLongStopMarket(0, true, _posSize, _stop, StopLong, EnterLongName);

    #2
    Hello mballagan,

    Thank you for your reply.

    The closest thing you could do would be to use the setting Enforce Immediate Fills. This may be turned on under Tools > Options > Trading > Enforce Immediate Fills.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello mballagan,

      Thank you for your reply.

      The closest thing you could do would be to use the setting Enforce Immediate Fills. This may be turned on under Tools > Options > Trading > Enforce Immediate Fills.

      Please let us know if we may be of further assistance to you.
      Thanks for your reply. The strategy has Calculate = Calculate.OnBarClose; When an EnterLong() or EnterShort() command is executed it appears to enter a position on the bar following the detected entry criteria. Would the Enforce Immediate Fills help in this case also?

      Comment


        #4
        Hello mballagan,

        Thank you for your reply.

        This would be the expected behavior when using Calculate.OnBarClose. When using this Calculate setting, the logic in OnBarUpdate will only run once per bar, when it closes. Consequently, any orders triggered by the bar data would be submitted when the next bar opens. Enforce immediate fills would have no effect on this.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by mattbsea, Today, 05:44 PM
        0 responses
        3 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        31 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        2 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,282 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        20 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Working...
        X