Code conversion needed: LEDGE ATR indicator
Forums › ProRealTime English forum › ProBuilder support › Code conversion needed: LEDGE ATR indicator
- This topic has 35 replies, 3 voices, and was last updated 6 years ago by crolakstrading.
-
-
02/22/2018 at 6:50 PM #63574
Hi Nicolas..
This is great. thanks very much!
the enter lines were going 2o pips above from ATR so i changed it and made it in.. and change the colours.. please see pic
+ Red line is 20 pips below from ATR to short entry
+ Green line is 20 pips above from ATR to go long
is there a way to move those RED and GREEN lines easily like adding variables.. lets i want go 30 pips instead of 20 pip? is there away to move them both 30 pips each way without going in and edit it!!.. is this possible??
thanks
02/23/2018 at 9:49 AM #6362402/26/2018 at 2:04 PM #63964Hi Nicolas.. i have tried hard to add these point distance… please can you check what im doing wrong.. it doesn’t do anything???
1234567891011121314151617181920212223242526272829303132defparam drawonlastbaronly=true// --- parametersATRperiod = 14// ---dTR = 0for i = 0 to ATRperioddTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))nextavg = dTR/ATRperiodconverted = round(avg/pointsize*10)/10htr = Dlow(0)+avg[1]ltr = Dhigh(0)-avg[1]if intradaybarindex=0 thenbegin=barindexendif// --- parameters//EP = 20// ---drawsegment(begin,htr,barindex,htr) coloured(200,100,0)drawsegment(begin,htr-20*pointsize,barindex,htr-20*pointsize) coloured(255,0,0) //EPdrawtext("#htr# - (D1atr: #converted#)",barindex,htr+10*pointsize,Dialog,Bold,10) coloured(200,100,0)drawsegment(begin,ltr,barindex,ltr) coloured(200,100,0)drawsegment(begin,ltr+20*pointsize,barindex,ltr+20*pointsize) coloured(0,255,0)//EPdrawtext("#ltr# - (D1atr: #converted#)",barindex,ltr-10*pointsize,Dialog,Bold,10) coloured(200,100,0)drawsegment(begin,Dopen(0),barindex,Dopen(0)) coloured(255,250,250)return02/27/2018 at 9:28 PM #64079Hi Nicolas.. a little help on this to make it work… really appreciated!!
03/02/2018 at 9:39 PM #64241Hi Nicolas..
is there a way keep the daily ATR price the same from market open price without changing???? what mean is the opening price at midnight, the ATR at that time, then the high/low price that remains static throughout the day. one we get the daily ATR price when market opens 0000.. that ART price remins the same place without changing??
please advice?
Many thanks
03/05/2018 at 2:08 PM #64442Just make only one time the dTR calculation at first bar of the day:
12345if intradaybarindex=0 thenfor i = 0 to ATRperioddTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))nextendif03/05/2018 at 7:25 PM #64486Hi nicolas,
Please can you check below.. it doesn’t seem to work properly.. also attached a pic below what i meant!! sorry to bother you again still learning.. I really appreciate your help!!!
1234567891011121314151617181920212223242526272829303132defparam drawonlastbaronly=true// --- parametersATRperiod = 14// ---dTR = 0if intradaybarindex=0 thenfor i = 0 to ATRperioddTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))nextendifavg = dTR/ATRperiodconverted = round(avg/pointsize*10)/10htr = Dlow(0)+avg[1]ltr = Dhigh(0)-avg[1]if intradaybarindex=0 thenbegin=barindexendifdrawsegment(begin,htr,barindex,htr) coloured(255,255,0)drawsegment(begin,htr+20*pointsize,barindex,htr+20*pointsize) coloured(255,0,0)drawtext("#htr# - (D1atr: #converted#)",barindex,htr+10*pointsize,Dialog,Bold,10) coloured(255,255,0)drawsegment(begin,ltr,barindex,ltr) coloured(255,255,0)drawsegment(begin,ltr-20*pointsize,barindex,ltr-20*pointsize) coloured(0,255,0)drawtext("#ltr# - (D1atr: #converted#)",barindex,ltr-10*pointsize,Dialog,Bold,10) coloured(255,255,0)drawsegment(begin,Dopen(0),barindex,Dopen(0)) coloured(255,250,250)return03/06/2018 at 10:26 AM #64556Try this one:
12345678910111213141516171819202122232425262728293031323334defparam drawonlastbaronly=true// --- parametersATRperiod = 14// ---if intradaybarindex=0 thenbegin=barindexreset=0dTR = 0endifif reset=0 thenfor i = 1 to ATRperioddTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))nextreset=1endifavg = dTR/ATRperiodconverted = round(avg/pointsize*10)/10htr = Dlow(0)+avg[1]ltr = Dhigh(0)-avg[1]drawsegment(begin,htr,barindex,htr) coloured(255,255,0)drawsegment(begin,htr+20*pointsize,barindex,htr+20*pointsize) coloured(255,0,0)drawtext("#htr# - (D1atr: #converted#)",barindex,htr+10*pointsize,Dialog,Bold,10) coloured(255,0,0)drawsegment(begin,ltr,barindex,ltr) coloured(255,255,0)drawsegment(begin,ltr-20*pointsize,barindex,ltr-20*pointsize) coloured(0,255,0)drawtext("#ltr# - (D1atr: #converted#)",barindex,ltr-10*pointsize,Dialog,Bold,10) coloured(255,0,0)drawsegment(begin,Dopen(0),barindex,Dopen(0)) coloured(255,250,250)return03/06/2018 at 8:19 PM #64617Hi Nicolas,
Just few issues with this… not sure why when the price move up or down lower or higher ATR moves towards open price and above. please see the picture..
* D atr says 94.2 but the line is not 94.2 away from Open price 0000??
03/07/2018 at 3:18 PM #64680Change lines 23 and 24 to:
12htr = Dopen(0)+avg[1]ltr = Dopen(0)-avg[1]1 user thanked author for this post.
03/10/2018 at 11:13 PM #64978Hi Nicolas…
that works really well… thank you so much for this!
is there a way to add price number to 20 pip above line at the moment its only the line..
1drawsegment(begin,htr+20*pointsize,barindex,htr+20*pointsize) coloured(255,0,0)How to add the price (number) on to this like your atr line? “#ltr# – (D1atr: #converted#)”
03/11/2018 at 6:12 PM #65010How to add the price (number) on to this like your atr line? “#ltr# – (D1atr: #converted#)”
Well, you already have everything in hands, examples at lines 28 and 31 of this post: https://www.prorealcode.com/topic/code-conversion-neededi/page/2/#post-64556
1 user thanked author for this post.
03/26/2018 at 11:15 PM #66491Thank you very much Nicolas,
I have been doing this strategy for past few weeks and given me 80% success on this. its really good!!
would it be a possible thing to make a screener.. lets say when its near ATR that we get a signal for that??
03/27/2018 at 8:02 AM #66506Sure, but could you explain the strategy please? I’m sure it will be of interest of many ones here. Thank you.
1 user thanked author for this post.
03/27/2018 at 3:58 PM #66571Of course. we want the market to stretch very quickly to daily ATR. once reach daily ATR you can enter aggressively at ATR or 20pips below or above! please see the picture to make it clear as this is today EURUSD. hope its clear?
-
AuthorPosts
Find exclusive trading pro-tools on