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 algospoke, Yesterday, 06:40 PM
        2 responses
        19 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        44 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        180 views
        0 likes
        Last Post jeronymite  
        Working...
        X