Newbie coding Request – BB S&R
Forums › ProRealTime English forum › ProBuilder support › Newbie coding Request – BB S&R
- This topic has 24 replies, 4 voices, and was last updated 5 years ago by denmar.
-
-
05/14/2017 at 3:17 PM #35485
Hi folks, I am new here and am absolutely useless at coding- loop etc just paralyze me. I am so pleased to have discovered this site as I tried unsuccessfully to code the QQE indicator (amongst others) which I have found at this site. I would lie to know, if it is possible in PRT, if somebody could help with the conversion of the following METASTOCK code (It plots horizontal lines at certain inflection points of Bollinger Bands.) Any suggestions would be greatly appreciated. Thanks in advance. The attached picture shows what the indicator looks like – also includes indicator for lower Bollinger band. Useful to alert one to potential future zones of Support/resistance and possible turning points.
ptpcnt:= 0.3;
bbu:= BBandTop(C ,20 ,S ,2 );
pbars:= PeakBars(1,bbu,ptpcnt);
tbars:= TroughBars(1,bbu,ptpcnt);
p1:= Peak(1, bbu, ptpcnt);
t1:= Trough(1, bbu, ptpcnt);
p1;
p1 – ValueWhen(1,p1<>Ref(p1,-1),ATR(40));
t1;
t1 – ValueWhen(1,t1<>Ref(t1,-1),ATR(40));
05/15/2017 at 7:56 AM #35532I’d like to help, but I have already encountered the same problem about Peak() and Trough() Metastock functions: I have no idea how it is calculated into the platform, even if I refer to the metastock programming documentation. These functions seems to be the same as zigzag but without the repainting behaviour.
I do not have metastock installed, maybe you could help if you have? We could compare my coding attempt with actual charts?
05/15/2017 at 8:02 AM #3553405/15/2017 at 8:10 AM #3553505/15/2017 at 8:51 AM #3553905/15/2017 at 9:21 AM #3554705/15/2017 at 9:29 AM #3555105/15/2017 at 9:36 AM #3555305/15/2017 at 9:55 AM #3555505/15/2017 at 10:02 AM #35556I am sorry but we are talking in cross purposes here. I do not have EOD data for EURUSD for Metastock. I therefore imported EOD data of EURUSD from Metatrader into Metastock. As a result of the importation the dates do not align. If you can give me the date that you are interested in I have to check in Metatrader to give you the corresponding date to see if they are the same. I hope this clears it up.
05/15/2017 at 10:11 AM #3555705/15/2017 at 10:24 AM #35562Nicolas, I do not subscribe to a EOD download. However, I have looked in my database and found that there is EOD EURUSD data until early 2015. However, the data since 2008 do not look reliable. I have therefore made a screen capture of 2005-to july 2007. Will you be able to work with this? If not, I am going to try and find a source on the internet for free EOD forex data for Metastock.
05/15/2017 at 12:51 PM #35582Well, I think I succeeded recreate the functions for probuilder. I’m still worried about correctly identify the peak and trough bars in the past (not important for your query though..), because Metastock language has also functions that fetch and retrieve the correct bars through history that create the peak and trough: PeakBars / TroughBars..
I will now try to translate the code of the metastock indicator you add in your first post.
05/15/2017 at 1:02 PM #3558505/15/2017 at 1:23 PM #35586Hi Nicolas
If you look at the first picture I posted you will see that the indicator plots the following:
2 horizontal lines at a specified peak on the top bollinger band – one at the peak and one 1atr less
2 horizontal lines at a specified trough on the top bollinger band – one at the peak and one 1atr less
2 horizontal lines at a specified peak on the bottom bollinger band – one at the peak and one 1atr more
2 horizontal lines at a specified trough on the bottom bollinger band – one at the peak and one 1atr more
Although the picture reflects a modified bollinger band the principle is still the same. As per the picture you can see that it often identifies areas of support/resistance and may lead to reversal or congestion. In the picture the reason for the pink lines is that if trading action is confined between these it can be considered to be in a trading range, outside of these trending (an arbitary definition).
-
AuthorPosts
Find exclusive trading pro-tools on