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 rhyminkevin, Today, 04:58 PM
        4 responses
        52 views
        0 likes
        Last Post dp8282
        by dp8282
         
        Started by iceman2018, Today, 05:07 PM
        0 responses
        5 views
        0 likes
        Last Post iceman2018  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        7 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        50 views
        0 likes
        Last Post futtrader  
        Working...
        X