| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | % atr what i want to do is have a lable that shows me % of ATR move in a given stock/future thanks. | ||
| |
|
| | #2 | ||
![]() | Re: % atr input: PeriodValue(7); vars: HighAtrTxt(-1), LowAtrTxt(-1),Atr(0),HighATR(0),LowA TR(0); Atr = AvgTrueRange (PeriodValue); //7 day ATR HighATR = HighD(1) + ATR; LowATR = LowD(1) - ATR; if BarType = 2 then begin HighAtrTxt = Text_New(Date, Time, HighATR, "High ATR"); LowAtrTxt = Text_New(Date, Time, LowATR, "Low ATR"); text_SetLocation(HighAtrT xt,date, HighATR, HighATR); text_SetLocation(LowAtrTx t,date, LowATR, LowATR); text_SetString(HighAtrTxt ,NumToStr(HighATR,0)+" High ATR"); text_SetString(LowAtrTxt, NumToStr(LowATR,0)+" Low ATR"); text_SetColor(HighAtrTxt, Green); text_SetColor(LowAtrTxt,G reen); end; | ||
| |
|
| | #3 | ||
![]() | Re: % atr so i am looking at the atr values of yesterday not before nor today's. i tried to use if CurrentBar = 1 then but it does not work thanks | ||
| |
|
| | #4 | ||
![]() | Re: % atr HTML Code: [LegacyColorValue = true];
input:
PeriodValue(7),
text.color(black),
decimal(2);
vars:
HighAtrTxt(-1),
LowAtrTxt(-1),
Atr(0),
HighATR(0),
LowATR(0);
Atr = AvgTrueRange (PeriodValue); //7 day ATR
HighATR = H[1] + ATR[1]; {<-- yestereday's ATR = ATR[1] }
LowATR = L[1] - ATR[1];
if currentbar = 1 then
begin
HighAtrTxt = Text_New(Date, Time, HighATR, "High ATR");
LowAtrTxt = Text_New(Date, Time, LowATR, "Low ATR");
text_Setcolor(HighAtrTxt, text.color);
text_Setcolor(LowAtrTxt, text.color);
text_Setstyle(HighAtrTxt, 0, 2);
text_Setstyle(LowAtrTxt, 0, 2);
end;
text_SetLocation(HighAtrTxt,date, time, HighATR);
text_SetLocation(LowAtrTxt,date, time, LowATR);
text_SetString(HighAtrTxt ," < "+NumToStr(HighATR,decimal)+" High ATR");
text_SetString(LowAtrTxt, " < "+NumToStr(LowATR,decimal)+" Low ATR"); Last edited by Tams; 02-08-2009 at 10:59 AM. | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |