Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged Order Exit Question

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

    Unmanaged Order Exit Question

    Can someone tell me why this line of codewith the specific line of CurrentBar >myentrybar + 15 is causing no exits?

    All of the code is located within BarsInProgress =0; , Primary chart data is 1 minute

    Code:
    if (Position.MarketPosition == MarketPosition.Long && entryOrder != null && entryOrder.Token != null && entryOrder.OrderState == OrderState.Filled && CurrentBar > myentrybar+15 && trailx == null && yox == null && profitx == null)
    				{
    					trailx = SubmitOrder(1,	OrderAction.Sell,	OrderType.Limit,	entryOrder.Quantity  , myhigh1[0] - trailvar2,0,	"2",	"TRAIL Long"	);	 	
    					//yox =	 SubmitOrder(0,	OrderAction.Sell, 	OrderType.Stop,		entryOrder.Quantity, 0, yostop,		"2",	"Yo Long");  
    					//profitx =	SubmitOrder(0,OrderAction.Sell,OrderType.Limit,Position.Quantity  	,entryOrder.AvgFillPrice+profitvar2,0,"2", "PROFIT Long "); 				
    				}
    I am trying to delay the exits by one, fifteen minute bar, or in other words 15 one min bars.

    #2
    neb1998, it would cause the absense of exits when the condition to do so is not triggering as you expect - are the involving variables print as you imagine?

    Also, on NT7 you would not need to use the token anymore, you can compare the IOrders directly now for equality.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    580 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    335 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    102 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X