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(0trueDefaultQuantityClose[0] - TickSize"Long 1a");
         
    Buy true;}
    if (
    Position.MarketPosition == MarketPosition.Flat && BarsInProgress == 1) {
       if (
    Buy == true && entryOrder1 != null && entryOrder1.LimitPrice != null && Close[0] == entryOrder1.LimitPrice 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 geddyisodin, Today, 05:20 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        3 responses
        31 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by timko, Today, 06:45 AM
        2 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by habeebft, Today, 07:27 AM
        0 responses
        4 views
        0 likes
        Last Post habeebft  
        Started by Tim-c, Today, 03:54 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X