How can I create a script that create both buy and sell order at 10 pips apart from the current price?
How can I create a script that create both buy and sell order at 10 pips apart from the current price?
One script create 2 orders buy and sell at the 10 pips apart from the current price.
Is it possible?
How can I create a script that create both buy and sell order at 10 pips apart from the current price?
One script create 2 orders buy and sell at the 10 pips apart from the current price.
Is it possible?
you can place pendingtrades 10 pips from current price if price goes in the direction of your pendingtrade and it reach its level then it will become normally a buy or sell
Yes it is possible . . . use OrderSend() to send the orders.
Yes it is possible . . . use OrderSend() to send the orders.
OrderSend(Symbol(), OP_BUYSTOP, 0.5, Ask + 100.0, 0, 0, 0);
OrderSend(Symbol(), OP_SELLSTOP, 0.5, Bid - 100.0, 0, 0, 0);
It complies without errors but it doesn't execute. Chart shows nothing. What's wrong?
OrderSend(Symbol(), OP_BUYSTOP, 0.5, Ask + 100.0, 0, 0, 0);
OrderSend(Symbol(), OP_SELLSTOP, 0.5, Bid - 100.0, 0, 0, 0);
It complies without errors but it doesn't execute. Chart shows nothing. What's wrong?
Ask + 100 ? did you mean . . .
Ask + (100 * Point)
Please use the SRC button to post code: How to use the SRC button.
What error is reported ? you are checking return values and reporting errors ?
When it is compiled, no error. When it is executed, only the first one is executed.
Why don't you try?
-------
How can I print the error to see?
When it is compiled, no error. When it is executed, only the first one is executed.
Why don't you try?
I don't have your code so I can't try it . . .
How can I print the error to see?

Raptor ~ This is the code. ;->
//+------------------------------------------------------------------+ //| OrderSendBothDirection.MPQ4 | //+------------------------------------------------------------------+ int start() { //---- int iSLPips=120; //Stop Loss in Pips int iTPPips=1000; //Take Profit in Pips int sp = 30; // Slippage double lot = 0.5; double dStopLoss = Bid - NormalizeDouble(iSLPips*Point,MarketInfo(Symbol(),MODE_DIGITS)); double dTakeProfit= Ask + NormalizeDouble(iTPPips*Point,MarketInfo(Symbol(),MODE_DIGITS)); OrderSend(Symbol(), OP_BUYSTOP, lot, Ask + (100*Point), sp, dStopLoss, dTakeProfit); OrderSend(Symbol(), OP_SELLSTOP, lot, Bid - (100*Point), sp, dStopLoss, dTakeProfit); return(0); } //+------------------------------------------------------------------+
It seems like OrderSend() function exit out of the script after its execution, if I am not mistaken.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How can I create a script that create both buy and sell order at 10 pips apart from the current price?
One script create 2 orders buy and sell at the 10 pips apart from the current price.
Is it possible?