How to place a sl/ tp at the upper bollinger band

 

Hi,

I am trying to place my SL/TP at the UPPER BOLLINGER BAND.

if(Highes_ >BOLLYUpper)TakeProfit =Highes_          

 if (UseTakeProfit) TakeProfitLevel =  TakeProfit ; else TakeProfitLevel = 0.0;

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

However the result is not what I expected.

Here an example


Can someone help me understand how to place this?


Thank you so much

 
billysballo:

I am trying to place my SL/TP at the UPPER BOLLINGER BAND.

However the result is not what I expected.

Here an example

Where does Highes_ get a value and where does TakeProfit get a value if the if condition is not satisfied?

 
Keith Watford:

Where does Highes_ get a value and where does TakeProfit get a value if the if condition is not satisfied?

so Highes comes from the iHigh function.

Takeprofit will not take a value if condition is not satisfied you are right on that point. However, if you look at my screenshot can you tell me why I m getting those values 30.0 rather than the actual price at the Bollinger Band?

 
billysballo:

so Highes comes from the iHigh function.

Takeprofit will not take a value if condition is not satisfied you are right on that point. However, if you look at my screenshot can you tell me why I m getting those values 30.0 rather than the actual price at the Bollinger Band?

As I don't know what calculations you are using, I cannot guess.

 
Keith Watford:

As I don't know what calculations you are using, I cannot guess.

TakeProfit should get the Price of the currency when it crosses the Upper Bollinger Bands.

So TakeProfit  should get a value which should look like 1.2045, but instead i get 30.0.

Does it make sense?

TakeProfit = the High price of the currency when it hits the UpperBolly.

if (UseTakeProfit) TakeProfitLevel =  TakeProfit ; else TakeProfitLevel = 0.0;

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

However the result is not what I expected.


Does TakeProfitLevel needs to be in Pips?

 
billysballo:

TakeProfit should get the Price of the currency when it crosses the Upper Bollinger Bands.

So TakeProfit  should get a value which should look like 1.2045, but instead i get 30.0.

Does it make sense?

TakeProfit = the High price of the currency when it hits the UpperBolly.

However the result is not what I expected.


Does TakeProfitLevel needs to be in Pips?

As I don't know what calculations you are using, I cannot guess.