ATR Trailing Stop - Help - page 6

 

ATR indicator

ATR indicator

Files:
p1.jpg  80 kb
 

Creating a chanel from EMA's

Hey there,

I'm working on a system that needs something along the following.

I know you can put levels in to make a channel. But I'm wanting to put a channel in of the ema that's a percentage of the ATR? How would I do this.

so for example. I'd have an ema of 15 and then the channels would be 'x' pips above and below the ema based on what the ATR is at that time. Say for instance 60% of the 15 ATR forms the channel.

Does this make sense? Anybody care to point me in the right direction of this?

Peace

Stuart

 
stubish:
Hey there,

I'm working on a system that needs something along the following.

I know you can put levels in to make a channel. But I'm wanting to put a channel in of the ema that's a percentage of the ATR? How would I do this.

so for example. I'd have an ema of 15 and then the channels would be 'x' pips above and below the ema based on what the ATR is at that time. Say for instance 60% of the 15 ATR forms the channel.

Does this make sense? Anybody care to point me in the right direction of this?

Peace

Stuart

See my post #36 on this thread.

 

Help with .MQ4 Indicator, Please

Hi.

Can anyone amend the attached 'ATR in Pips' Indicator to include the facility to place the displayed text anywhere on the Chart window using 'x' and 'y' co-ordinates?

Hope so. Thanks in anticipation. Richard.

Files:
 

Text Shift

DM3554:
Hi.

Can anyone amend the attached 'ATR in Pips' Indicator to include the facility to place the displayed text anywhere on the Chart window using 'x' and 'y' co-ordinates?

Hope so. Thanks in anticipation. Richard.

This should do eveything you require

extern int TextShift_Side =0;

extern int TextShift_UP_DN = 0;

extern color TextColor = White;

extern int TextSize = 9;

extern string TextFont = "Tahoma";

extern int TextCorner = 0;

Update : I forgot to put the ObjectDelete to delete the LABEL - sorry for any inconvenience caused.

atr_in_pips_v1.mq4

Files:
 

cja - That's perfect ..... Thanks

cja, that's perfect .... thanks. And implemented so quickly.

Thank you, Richard.

cja:
This should do eveything you require

extern int TextShift_Side =0;

extern int TextShift_UP_DN = 0;

extern color TextColor = White;

extern int TextSize = 9;

extern string TextFont = "Tahoma";

extern int TextCorner = 0;

Update : I forgot to put the ObjectDelete to delete the LABEL - sorry for any inconvenience caused.

 

hello,

I use atr based stop different formula, my stop loss method dont need close.

My formula are below as metastock language.

FOR LONG STOP

HHV(L- 2*Ref(Mov(Max(H-L,Max(Abs(H-Ref(C,-1)),

Abs(L- Ref(C,-1)))),14,S),-1),14)

FOR SHORT STOP

LLV(H+ 2*Ref(Mov(Max(H-L,Max(Abs(H-Ref(C,-1)),

Abs(L-Ref(C,-1)))),14,S),-1),14)

I dont know MT4 coding, somebody may code for MT4 as two indicators. Thanks.

 

ATR STOP LOSS with Ratchet

Hi to all,

does anybody have the MT4 code for what MTPredictor uses as ATR STOP loss with ratchet? See attached file, please.

Not use to tell me it'here on this site, because it istn't! I checked it up!

thanks,

Tigrotto

Files:
 

Atr trailiong stop

Hi all

Please can i have your ideas to what are the best parameters for atr trailing stop. So far i have been using 10/4

Cheers

Colin

 

HELP with ATR indicator.

Can someone help me to create an price tag in this atr indicator. It's only like 5 lines of code.

example:

I want the must current atr line. The first from right to left to have a price level to move my stop easily. Its time consuming to have to move the mouse cross line and find out what price it is.

Example:

______________________| 1.5421|

It's gotta be with objectcreate(arrow) but dont know how to do it.

I want the arrow label in the current atr line.

Thanks everybody.

//+------------------------------------------------------------------+

//| ATR Trailing Stop.mq4 |

//| |

//| |

//+------------------------------------------------------------------+

#property copyright "Copyright Team Aphid"

#property link ""

//---- indicator settings

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Purple

#property indicator_color2 Purple

#property indicator_width2 1

#property indicator_width1 1

//---- indicator parameters

extern int BackPeriod =700;

extern int ATRPeriod =3;

extern double Factor=3;

extern bool TypicalPrice=false;

//---- indicator buffers

double ind_buffer1[];

double ind_buffer2[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- drawing settings

SetIndexStyle(0,DRAW_LINE,EMPTY,1);

SetIndexDrawBegin(0,ATRPeriod);

SetIndexBuffer(0,ind_buffer1);

SetIndexStyle(1,DRAW_LINE,EMPTY,1);

SetIndexDrawBegin(1,ATRPeriod);

SetIndexBuffer(1,ind_buffer2);

IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);

//---- name for DataWindow and indicator subwindow label

IndicatorShortName("ATR Trailing Stop("+ATRPeriod+" * "+Factor+")");

SetIndexLabel(0,"Support");

SetIndexLabel(1,"Resistance");

//---- initialization done

return(0);

}

//+------------------------------------------------------------------+

//| Moving Averages Convergence/Divergence |

//+------------------------------------------------------------------+

int start()

{

int limit;

int counted_bars=IndicatorCounted();

double PrevUp, PrevDn;

double CurrUp, CurrDn;

double PriceLvl;

double LvlUp=0;

double LvlDn=1000;

int Dir=1;

int InitDir;

//---- check for possible errors

if(counted_bars<0) return(-1);

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

//---- fill in buffervalues

InitDir=0;

for(int i=BackPeriod; i>=0; i--)

{

if (TypicalPrice) PriceLvl=(High + Low + Close)/3;

else PriceLvl=Close;

//----

if(InitDir==0)

{

CurrUp=Close - (iATR(NULL,0,ATRPeriod,i) * Factor);

PrevUp=Close - (iATR(NULL,0,ATRPeriod,i-1) * Factor);

CurrDn=Close + (iATR(NULL,0,ATRPeriod,i) * Factor);

PrevDn=Close + (iATR(NULL,0,ATRPeriod,i-1) * Factor);

//----

if (CurrUp > PrevUp) Dir=1;

LvlUp=CurrUp;

if (CurrDn < PrevDn) Dir=-1;

LvlDn=CurrDn;

InitDir=1;

}

CurrUp=PriceLvl - (iATR(NULL,0,ATRPeriod,i) * Factor);

CurrDn=PriceLvl + (iATR(NULL,0,ATRPeriod,i) * Factor);

//----

if (Dir==1)

{

if (CurrUp > LvlUp)

{

ind_buffer1=CurrUp;

LvlUp=CurrUp;

}

else

{

ind_buffer1=LvlUp;

}

ind_buffer2=EMPTY_VALUE;

if (Low < ind_buffer1)

{

Dir=-1;

LvlDn=1000;

}

}

if (Dir==-1)

{

if (CurrDn < LvlDn)

{

ind_buffer2=CurrDn;

LvlDn=CurrDn;

}

else

{

ind_buffer2=LvlDn;

}

ind_buffer1=EMPTY_VALUE;

if (High > ind_buffer2)

{

Dir=1;

LvlUp=0;

}

}

}

//----

return(0);

}

//+------------------------------------------------------------------+