# Multi Timeframe Indicators - page 1129

216406

Jeaa:

2016.09.06 11:42:06.700 NewBar_jeaa_Rev 2 USDJPY,M1: Alert: USDJPY: Barras= 3, Min= 102.11600
2016.09.06 11:41:36.561 NewBar_jeaa_Rev 2 USDJPY,M1: Alert: USDJPY: Barras= 3, Min= 102.11600
2016.09.06 11:41:36.561 NewBar_jeaa_Rev 2 USDJPY,M1: trade operations not allowed by settings
2016.09.06 11:41:36.396 NewBar_jeaa_Rev 2 USDJPY,M1: initialized
2016.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.000
2016.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.000

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

15

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);

And work properlly.

Best regards.

Jesús

216406

Jeaa:

Thanks for your help... I changed for:

double SL=NormalizeDouble(Precio - StopLoss*Point,Digits);
double TP=NormalizeDouble(Precio + TakeProfit*Point,Digits);

And work properlly.

Best regards.

Jesús

[Deleted]

Hi guys,

thank you very much :)

Files:
52

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 :)

Cheers.

Sameer

Files:
216406

Hi guys,

thank you very much :)

Here is a version with that added

Files:
216406

sameermehta74:

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 :)

Cheers.

Sameer

You have a very easy solution. Add this line :

`      StringReplace(Symbols,"current",_Symbol);`

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)

Files:
52

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)

Thank you :) Much appreciated.
5115

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 ?

regards

216406

mntiwana: