could you use that in context with the provided script? i still don't understand...
could you use that in context with the provided script? i still don't understand...
It's probably better to make it EA instead of script
i'm trying to write a code that will open 6 trades, 3 buys, and 3 sells.
I have a script set to place orders with a Ask/Bid-15, 20, and 25 stop loss, but i want to add a trailing stop with the same values as the stop loss. How do i do this?
here's the script -
int start()
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-15*Point,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-20*Point,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-25*Point,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+15*Point,0,"JMSELLER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+20*Point,0,"JMSELLER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+25*Point,0,"JMSELLER",0,0,CLR_NONE);
}
deymer, consider reading about Client Terminal design and it's single trade thread concepts, as your code will not realise your intentions.
ClientTerminal can only issue one Trade Operation to server at a time. You code must be aware when it is feasible to issue order. The shotgun approach will fail.
deymer, consider reading about Client Terminal design and it's single trade thread concepts, as your code will not realise your intentions.
ClientTerminal can only issue one Trade Operation to server at a time. You code must be aware when it is feasible to issue order. The shotgun approach will fail.
"ClientTerminal can only issue one Trade Operation to server at a time."
I was just using it today.I executed the script and it placed 6 trades at once, well... they had to load one by one, but still, the shotgun strategy held some merit. I just need to figure out how to add a trailing stop to the initial stop loss...
"ClientTerminal can only issue one Trade Operation to server at a time."
I was just using it today.I executed the script and it placed 6 trades at once, well... they had to load one by one, but still, the shotgun strategy held some merit. I just need to figure out how to add a trailing stop the the initial stop loss...
bump
how do i add a trailing stop to the following order placement script?
int start()
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-15*Point,0,"JMBUYER",0,0,CLR_NONE);
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
i'm trying to write a code that will open 6 trades, 3 buys, and 3 sells.
I have a script set to place orders with a Ask/Bid-15, 20, and 25 stop loss, but i want to add a trailing stop with the same values as the stop loss. How do i do this?
here's the script -
int start()
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-15*Point,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-20*Point,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-25*Point,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+15*Point,0,"JMSELLER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+20*Point,0,"JMSELLER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+25*Point,0,"JMSELLER",0,0,CLR_NONE);
}