Closing Order On PT hit
4 replies
jonnywolf
11 years ago #110917
I have two pending orders setup, when one is hit and then proceeds to the take profit I want to close the other pending order.
At the moment I have tried OrderPT(magic number)=TargetProfit
But it does'nt seem to be closing the other order.
Any ideas?
Cheers,
James
Mark Fric
11 years ago #121008
I have two pending orders setup, when one is hit and then proceeds to the take profit I want to close the other pending order.
you can use this kind of condition:
OrderClosedThisBar(magic number) && Closed P/L(magic number) > 0
this will be triggered when order with given magic number just ended and ended in profit
Mark
StrategyQuant architect
jonnywolf
11 years ago #121011
Ok fixed
stearno
11 years ago #121159
I have a stop order created at a price level. How do I delete it if conditions are no longer favorable and the stop order was not hit?
Does EA automatically delete itself when the IF conditions are no longer valid or do I have to create a rule to delete this pending stop order?
If I have to delete, how do I do it because I found conditions saying existing pending order, but I could find in the THEN conditions how to close/delete the pending order. Thanks.
-Stearno
Mark Fric
11 years ago #121195
Hello,
every stop/limit order can have expiration (Bars valid property) – you can specify how many bars it should be valid. After that it will be closed automatically.
You can also close any order manually by calling function Close position – this will close both open and pending orders.
regards,
Mark
Mark
StrategyQuant architect
Viewing 4 replies - 1 through 4 (of 4 total)