Showing customized daily Indicators in smaller timeframes?
Forums › ProRealTime English forum › ProRealTime platform support › Showing customized daily Indicators in smaller timeframes?
- This topic has 5 replies, 2 voices, and was last updated 8 years ago by Xerxes.
-
-
05/20/2016 at 12:50 PM #7519
Hello,
I would like to show the Pivot Point Support 3, Resistance 3 and the Average True Range on a daily basis in smaller timeframes in a chart for the actual day only.
Somehow there is a strange behaviour with different timeframes.
Timeframe = daily -> shows nothing
Timeframe = 4hrs -> shows PP and ATR lines, but for today and the day before
Timeframe = 1hrs – 15min -> shows PP and ATR lines for today (as expected)
Timeframe = 10min – 1min -> shows only PP (ATR lines are missing)
Does somebody know, where the problem is?
Thanks in advance!
Here is the code:
1234567891011121314151617181920212223242526272829303132333435IF Date = Today THENDH=DHIGH(1)DL=DLOW(1)DC=DCLOSE(1)PP=(DH+DL+DC)/3//Res1=PP+(PP-DL)//Res2=PP+(DH-DL)Res3=DH+2*(PP-DL)//Sup1=PP-(DH-PP)//Sup2=PP-(DH-DL)Sup3=DL-2*(DH-PP)n=14f=1SumTR=0for i=1 to n doTH=max(DHigh(i),DClose(i+1))TL=min(DLow(i),DClose(i+1))TrueR=TH-TLSumTR=SumTR+TrueRnextATR=SumTR/nATRo=PP+ATR*fATRu=PP-ATR*felse//Sup1 = undefined//Sup2 = undefinedSup3 = undefined//Res1 = undefined//Res2 = undefinedRes3 = undefinedATRo = undefinedATRu = undefinedendifreturn Sup3 COLOURED(0,0,255),Res3 COLOURED(255,0,0),ATRo COLOURED(255,0,0),ATRu COLOURED(0,0,255)05/20/2016 at 4:29 PM #754105/20/2016 at 6:35 PM #7568Hello Adolfo Onrubia,
thank you for your reply. If you have used the same code then the result is a little bit strange.
For me the code works perfect between 15mins and 1 hour only. The rest of the time the result is not as it used to be as described before (see pictures attached):
Timeframe = daily -> shows nothing
Timeframe = 4hrs -> shows PP and ATR lines, but for today and the day before
Timeframe = 1hrs – 15min -> shows PP and ATR lines for today (as expected)
Timeframe = 10min – 1min -> shows only PP (ATR lines are missing)
If you have got an idea what the mistake could be, you are highly welcome!
Thank you
05/20/2016 at 6:52 PM #7574For the daily setup the correct values are shown on the vertical axis. So there are not small lines but only points that can not be seen.
But I do not know why for the 4hrs setup there are no straight lines. Instead there are polylines which should not be.
The 5min setup does not show the values for the average true range at all.
05/20/2016 at 6:56 PM #7575Yes Xerxes, I got a Master in Copy/Paste a few years ago!! hehehe! I used your shared code here.
I realize on one thing, since you’re using daily bars with the code:
1IF Date = Today THENI think it will not work because intradaybars are not checked. (Hope someone put me on the right way if I’m wrong at this point)
For other issues with 4h, 1m or 5m… I tryed it on DAX and worked fine. No others tested.
Where are you testing it?
05/21/2016 at 11:34 AM #7614Thank you Master of copy and paste 😉
I think the problem is related to the data structure of the candles itself and the configuration of the trading timeframe for each instrument.
I tested the code on the german DAX but with other instruments it is the same problem. Some timeframes work and some not.
Attached there is a picture of the Dow Jones on a daily basis. There the indicator works perfect. But on smaller timeframes there is a different behaviour, too.
Mmm…I have got no idea!
-
AuthorPosts
Find exclusive trading pro-tools on