Can I pass as Argument here that TP is a condition not a value ?
yes, you can use OrderClose() to close the order, once TP condition is met.
On this example below
Line 1 receives a signal to sell and checks for any open short positions
Line 2 defines the Vol, Price, SL, TP
if (signal =="sell" && PositionsTotal()<1)
trade.Sell(1.0,NULL,Bid,0,(Bid-200 * _Point),NULL);
My question is :
Can I pass as Argument here that TP is a condition not a value ?
No. A TP is a price associated with an order sent to the broker. If you want a conditional TP it has to be managed by code as answered by Mohamad.
Perhaps he wants TP to be triggered after some value, like a buy stop-limit...
On this example below
Line 1 receives a signal to sell and checks for any open short positions
Line 2 defines the Vol, Price, SL, TP
if (signal =="sell" && PositionsTotal()<1)
trade.Sell(1.0,NULL,Bid,0,(Bid-200 * _Point),NULL);
My question is :
Can I pass as Argument here that TP is a condition not a value ?
If you get a BUY signal or at a given price level, you can send a CLOSE_BY request for closing a SELL with a BUY. If the BUY has larger volume it will result in a reverse trade.
Perhaps he wants TP to be triggered after some value, like a buy stop-limit...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
On this example below
Line 1 receives a signal to sell and checks for any open short positions
Line 2 defines the Vol, Price, SL, TP
if (signal =="sell" && PositionsTotal()<1)
trade.Sell(1.0,NULL,Bid,0,(Bid-200 * _Point),NULL);
My question is :
Can I pass as Argument here that TP is a condition not a value ?