Hi mladen... Thanks for your reply...
2016.09.06 11:42:06.700 NewBar_jeaa_Rev 2 USDJPY,M1: Alert: USDJPY: Barras= 3, Min= 102.116002016.09.06 11:41:36.561 NewBar_jeaa_Rev 2 USDJPY,M1: Alert: USDJPY: Barras= 3, Min= 102.116002016.09.06 11:41:36.561 NewBar_jeaa_Rev 2 USDJPY,M1: trade operations not allowed by settings2016.09.06 11:41:36.396 NewBar_jeaa_Rev 2 USDJPY,M1: initialized2016.09.06 11:41:36.385 NewBar_jeaa_Rev 2 USDJPY,M1 inputs: GV_CantidadBarras=3; digits=5; Lots=0.01; StopLoss=100.0; TakeProfit=100.0; Slippage=3; 2016.09.06 11:41:35.080 Expert NewBar_jeaa_Rev 2 USDJPY,M1: loaded successfully
2016.09.06 12:57:08.587 '502630': order buy 0.01 USDJPY opening at market sl: 50.000 tp: 50.000 failed [Invalid S/L or T/P]2016.09.06 12:57:08.268 '502630': order buy market 0.01 USDJPY sl: 50.000 tp: 50.0002016.09.06 12:56:07.224 '502630': order buy 0.01 USDJPY opening at market sl: 50.000 tp: 50.000 failed [Invalid S/L or T/P]2016.09.06 12:56:06.921 '502630': order buy market 0.01 USDJPY sl: 50.000 tp: 50.0002016.09.06 12:56:04.221 Automated trading enabled
As you can see your stop loss and take profit are wrong
You are calculating those wrong : stop loss and take profit are calculated as order open price +- stop loss and/or take profit (the + or - depends on the type of the orders) but not as 50 (like in your case) but it would be order open price +- 50*_Point (for points) or 50*_Point*MathPow(10,MathMod(_Digits,2)) for pips distance from the order open price
Thanks for your help... I changed for:
double SL=NormalizeDouble(Precio - StopLoss*Point,Digits); double TP=NormalizeDouble(Precio + TakeProfit*Point,Digits); int ticket=OrderSend(Symbol(),OP_BUY,Lots,Precio,Slippage,SL,TP,"Jeaa",0,0,Blue);
And work properlly.
May you add the time frame in the alert message in the file attached please ?
thank you very much :)
Apologies for posting this request here as I am not aware of right place.
Is it possible to add an option of Current Symbol Only in the attached indicator.
If you could, it would really help a lot :)
Here is a version with that added
You have a very easy solution. Add this line :
before line 64, and then in the symbols list enter "current" any where in the string (without the ""), and it will be replaced with the current symbol. Or use the attached :) (same rules for the current symbol applied : to have only the current symbol displayed, enter only "current" in the symbols list)
Is this a general/standard coding formula to add current symbol option in any indicator ?
No. Just in the case of this indicator