Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Time Frame Strategy Cancellation

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

    Multi Time Frame Strategy Cancellation

    Hello,

    I currently have a multitimeframe strategy setup on 4 range and 1 range bars. 4 range handle the entry conditions and initial entry order, while the 1 range series handles order cancellation if the close price moves 2 ticks away from entry order.
    The problem im having is that once an order has been placed, a cancellation preceeds it immediately.

    PHP Code:
    if (Position.MarketPosition == MarketPosition.Flat && BarsInProgress == 0) { 
      if (Bla Bla) {
         entryOrder1 = EnterLongLimit(0, true, DefaultQuantity, Close[0] - 2 * TickSize, "Long 1a");
         Buy = true;}
    if (Position.MarketPosition == MarketPosition.Flat && BarsInProgress == 1) {
       if (Buy == true && entryOrder1 != null && entryOrder1.LimitPrice != null && Close[0] == entryOrder1.LimitPrice + 2 * TickSize) { 
       CancelOrder(entryOrder1);
       Buy = false;} 
    
    The issue seems to be the use of Close[0] in BarsArray = 1. If I use Closes[0][0], it will wait for next 4 range bar to close before cancelling order, which is too far away.
    I cannot use Indicator(BarsArray[1])[0] command as the indicator is custom 3rd party.
    CalculateonBar close is true.
    Any ideas on how to combat this?

    Thanks

    James


    #2
    James,

    I suggest you actually print what the Close[0] is and what your LimitPrice is being evaluated as. Then compare it to what you see on the chart to see how they can be evaluated together.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hey Josh,

      Yeah i have done that. The problem still exists though.

      Comment


        #4
        jthom,

        Can you please provide me with what kind of print outs you were receiving numerically? Thank you.

        Also, please turn on TraceOrders = true so you can see the exact reason an order was cancelled. Thanks.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        61 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        40 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        21 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        23 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        51 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X