Download MetaTrader 5

What code to use to add a multiplier to an ATR?

To add comments, please log in or register
tha
73
tha  

Hello,


this is my rule for closing a sell trade:

if((Bid>iATR(NULL,0,14,1)))


please could somebody tell me what I need to change in that code if I wanted to use three times the ATR (14) value (creating more distance from the bid, not a longer lookback period for the ATR)?


Thank you!

Carl Schreiber
7291
Carl Schreiber  

You are mixing apples with onions.

Bid is price but ATR is the difference of two prices! Maybe you meant something like:

   
   if(Bid > entry + c*iATR(..) ) { ...

Please use the SRC button for posted code.

tha
73
tha  
Carl Schreiber:

You are mixing apples with onions.

Bid is price but ATR is the difference of two prices! Maybe you meant something like:

Please use the SRC button for posted code.


Thank you very much!! Yes, that's what I'm after!

Apologies for expressing it misleadingly

To add comments, please log in or register