ATR Trailing Stop - Help - page 8

 
larperguy813:

I want the file to be changed to an indicator. Right now it's an EA. Is this possible? Even with the sound, and the alert can it be just an indicator?

Also - I set up my mt4 to visually show me the spike as well. The EA runs fine on a blank chart, but I also set up ATR(1) and ATR(60) so that when a spike happens I can look at the two lines to see. Is there a way this can be converted to an indicator to work as designed, but also when the indicator is loaded, the 2 ATR lines show up at the bottom as well so we can see this visually. The point is to distribute this to people who can load this as easily as possible.

Thanks for any help!!!!!!

Anyone out there that can lend a hand?

 

Made a breakthrough... sorta.

OK... since I have already programmed an EA to give me a popup and alert noise when the parameters are hit, I focused on creating the indicator that combines fast ATR (ATR(1)), slow ATR (ATR(60)), and also the slow ATR multiplied by a variable, probably 3 (ATR(60*3)).

I am semi successful with this indicator. However.... they are 3 flat lines! (Look at picture) I know there's something missing and it is minor.... I think it has to do with the count/countedbars, etc. Can someone fix this for me?? Thank you!!

#property copyright "xx"

#property link "website"

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 DeepSkyBlue

#property indicator_color2 Yellow

#property indicator_color3 Green

extern int fastATRperiod = 1;

extern int slowATRperiod = 80;

extern int slowATRmultiplier = 3;

extern int alertSleepMins = 0;

//---- buffers

double fastATR[];

double slowATR[];

double multipliedATR[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,fastATR);

SetIndexLabel(0,"fastATR");

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(1,slowATR);

SetIndexLabel(1,"slowATR");

SetIndexStyle(2,DRAW_LINE);

SetIndexBuffer(2,multipliedATR);

SetIndexLabel(2,"multipliedATR");

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int counted_bars = IndicatorCounted();

int CalculateBars = Bars - counted_bars;

for(int Count = Bars; Count >= 0; Count--)

{

fastATR[Count] = iATR(NULL,0,fastATRperiod,0);

slowATR[Count] = iATR(NULL,0,slowATRperiod,0);

multipliedATR[Count] = ((iATR(NULL,0,slowATRperiod,0)) * slowATRmultiplier);

}

//----

//----

return(0);

}

//+------------------------------------------------------------------+
Files:
 

Figured it out on my own

However... in case anyone can help here..... I want to get the alert sound and pop up.... but not every tick. If the alert goes off, I want it to sleep() for x milliseconds, which is specified in the externs. Or I want a better bit of code to tell it to only do it once and wait to start monitoring next bar. Anyone know what to do here? The milliseconds method worked for the EA, but not now that it's an indicator. Help please

Files:
 

anyone have idea to making ATR Trailing stop to be adaptive by adjusting multiplier dynamically?

i've tried it with fractal efficiency ratio but no luck. because the multiplier for ATR stop should be adjusted between 1.5 ~ 4 approximately.

 

flexible ATR stops?

r4bb1t:
anyone have idea to making ATR Trailing stop to be adaptive by adjusting multiplier dynamically? i've tried it with fractal efficiency ratio but no luck. because the multiplier for ATR stop should be adjusted between 1.5 ~ 4 approximately.

R4bb1t,

I would be happy to help if I can. What are you thinking with regard to adjusting the ATR multiple? Since ATR is a measure of volatility, the multiple for an ATR stop can be thought of as the risk tolerance of the trader.

Depending on the price action, it could make sense to adjust risk tolerance up or down. But how would we find the "right" risk tolerance? Is fractal efficiency ratio the best measure, or is there something better?

 

Need ATR Trailing Stop modification, Please

Hi All

This is the best trailing stop EA ever, but i have to give the ticket number to manage my position (single position). I want to manage it all my position on the chart.For example all EURUSD position .

ATRstop_v1.1 indicator is help to see where is the ATR

Please help

 

Need help to code ATR trailing stop

i'm new in mt4, I do need help to modify the below code:

the basic concept is like this :

1. Initial & Trail stop

- initial stop is 2 or 3 ATR (15 days) counted from the high or low the current price bar.

- I want the stop to move (trail) only when the price make highest high or lowest low at least 1 or 2 ATR from the last stop, if less than 1 or 2 ATR, then the stop is remain the same.

2. Stop hit & reverse

- If the price close below the stop (long) or above the stop (short) , then the stop reverse and set as 2 or 3 ATR stop.

anyone help will be appreciated.

tks

Rudy

Files:
 

ATR indicator

hi,

i'm trying to build an atr indicator that shows how much a set of currency pairs has moved in pips and then compare them to the atr before entering. what i'm going for is something like;

Commodity Pairs (H4 or any time frame)

Pips Moved 50% ATR (20)

AUDUSD 50 42

EURAUD -65 70

AUDJPY 30 43

in the example, above i can go long on AUDUSD because it already moved more than 42 pips. i will also wait until EURAUD go down another 5 pips before going short.

i have attached what i have so far, it subtracts the open price from the current bid. the problem with this is the data becomes stale after some time and i have to restart mt4 to refresh it.

by the way i have no coding skill and this is my first attempt for an indicator so please bear with me.

thanks,

jay

Files:
 

NRTR ATR stop indicator (periods 20,30,40,50)

Files:
 

Need help to code ATR trailing stop

i'm new in mt4, I do need help to modify the below code:

the basic concept is like this :

1. Initial & Trail stop

- initial stop is 2 or 3 ATR (15 days) counted from the high or low the current price bar.

- I want the stop to move (trail) only when the price make highest high or lowest low at least 1 or 2 ATR from the last stop, if less than 1 or 2 ATR, then the stop is remain the same.

2. Stop hit & reverse

- If the price close below the stop (long) or above the stop (short) , then the stop reverse and set as 2 or 3 ATR stop.

anyone help will be appreciated.

tks

Rudy

Attached Files

File Type: mq4 ATRStops_v11.1.mq4 (3.0 KB, 84 views)

Reason: