Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

runner with onexecution update

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

    #16
    Never mind I found an extra logic that cacels the order.
    Now i need to understand why entry hasnt moved to High[1], it seems because entry condition looks for entryOrder which is not null. So do I need to cancel this order? if so onBarUpdate? or on OrderUpdate?

    if(longPrice >= GetCurrentAsk() && entryOrder == null ){
    EnterLongStopMarket(0,true, PositionSize, longPrice, "MyEntryLong");

    if(TradeRunner && entryOrderRunner == null)
    {
    EnterLongStopMarket(0,true, PositionSizeRunner, longPrice, "MyEntryLongRunner");
    }​


    -----
    Would this be the approach to cancel order so entry is based on High[1]?
    if(Position.MarketPosition == MarketPosition.Flat && IsFirstTickOfBar && entryOrder != null)
    {

    tradeLongCancelled = true;
    CancelOrder(entryOrder);
    if(TradeRunner && entryOrderRunner != null)
    {

    CancelOrder(entryOrderRunner);
    }
    }​
    Click image for larger version  Name:	image.png Views:	0 Size:	38.7 KB ID:	1311099
    Last edited by tkaboris; 07-18-2024, 05:41 AM.

    Comment


      #17
      Hello tkaboris,

      It looks like we are off topic here, if you are coding other steps now you will need to use prints to see why your logic is working in that way. Your original question was about submitting a second entry and targets, if you have other questions about moving an order or cancelling an order please make a new post and include specific details on how we can assist and how you have debugged the code up to that point. If you have otherwise resolved your original concern we can close this thread.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X