I started using/coding PRT last month, so please be kind. This is my first indicator, good for entry/exit positions.
Based on Bollinger Bands percentage width, it gives signals when bands are exiting from previous contraction periods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
MyBoll = (close[0] - BollingerDown)/(BollingerUp - BollingerDown)*100 MyBoll2 = (high[0] - BollingerDown)/(BollingerUp - BollingerDown)*100 MyBoll3 = (Low[0] - BollingerDown)/(BollingerUp - BollingerDown)*100 X = (myBoll2[0] + myBoll2[1] + myBoll2[2]) /3 Y = (myBoll3[0] + myBoll3[1] + myBoll3[2]) /3 rge = averagetruerange[10](close) if MyBoll >= 50 THEN upBoll = X > 100 downBOLL = 0 ELSE upBOLL = 0 downBOLL = Y < 0 ENDIF If upBOLL[1] > 0 and upBOLL = 0 then DRAWARROWDOWN(barindex[1],high[1]+rge)coloured(249,0,224) endif if downboll[1] > 0 and downboll = 0 then DRAWARROWUP(barindex[1],low[1]-rge)coloured(0,249,45) endif RETURN |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Nice simple idea and indi, thanks for sharing!
Bonjour Thomas
Pour un premier indicateur c’est plutôt bien !
Est-il possible de le peaufiner un peu en ajoutant 2 variables des Bollinger, c’est à dire la période et l’écart.
Tu as pris période = 20 et écart = 2 ?
Bonne journée et bons trades
Hey, I’m sure you can tweak it a bit. Go ahead and try different settings and feel free to post the code here. Good trades!
nice idea, really.
it s possbile that someone this coded in a strategy, the drawarrows as an entry?
i would test and optimize with some filters tu get out some the false entries
and would post the results.
Can do someone this?
JohnScher – what kind of filters do you have in mind? and what would be the purpose?
i would test an optimize with some classic filters rsi, williams chandle, ease of movement, price rate of change to get out false signals
That’s my point, I use this indicator on daily basis but very often get false signals to enter. It would be good to have an open discussion, and present more points of view on this topic.
So, and now who would write the code ?
Hi all , i am newbie here, the above bollinger moz indicator for which platform , is it not for amibroker
This website is dedicated to prorealtime trading platform programming.
Hi, If anyone would like to try using this indicator for entry/exit you can use a code similar to this. I tried on dax but you can change to whatever you want.
DEFPARAM cumulateorders = false
DEFPARAM flatbefore = 080000
DEFPARAM flatafter = 220000
MA1 = average[25]
MA2 = average[25]
MyBoll = (close[0] – BollingerDown)/(BollingerUp – BollingerDown)*100
MyBoll2 = (high[0] – BollingerDown)/(BollingerUp – BollingerDown)*100
MyBoll3 = (Low[0] – BollingerDown)/(BollingerUp – BollingerDown)*100
X = (myBoll2[0] + myBoll2[1] + myBoll2[2]) /3
Y = (myBoll3[0] + myBoll3[1] + myBoll3[2]) /3
if MyBoll >= 50 THEN
upBoll = X > 100
downBOLL = 0
ELSE
upBOLL = 0
downBOLL = Y 120000 and currenttime 0
b1 = b1 and downboll = 0
b1 = b1 and close > MA1
If b1 then
Buy 1 contract at market
endif
// sell signal
b2 = longonmarket
b2 = b2 and upBOLL[1] > 0
b2 = b2 and upBOLL = 0
if b2 then
sell at market
endif
//SHORT
// Sell signal
s1 = not onmarket
s1 = s1 and currenttime > 120000 and currenttime 0
s1 = s1 and upBOLL = 0
s1 = s1 and close 0
s2 = s2 and downboll = 0
If s2 then
exitshort at market
endif
Thanks, so this is a complete strategy? How it performs?
No it’s not complete. Stop target and proper testing is missing. I just wrote it to show whoever asked about trading this in a strategy how it might look in a coded system. I tested it on dax. Not a very good return but it’s not terrible either. It’s on plus for several timeframes. Think the return can be much better with some more research.
Hi Victormork, Your Code doesn´t work on PRT 10.3 (Syntaxfehler R20 Type 18)
Hi! I’m using 10.3 myself so that’s not the problem. I think the problem are the last lines in the code. they should be like this:
It didn’t work using the add PRT code button. I’ll try again without it.
//SHORT
// Sell signal
s1 = not onmarket
s1 = s1 and currenttime > 120000 and currenttime 0
s1 = s1 and upBOLL = 0
s1 = s1 and close 0
s2 = s2 and downboll = 0
If s2 then
exitshort at market
endif
sorry the code keep on changing when I press post comment. Basically you have to complete the SHORT section the same way as I done with the long. I’ve tried one final time below.
s1 = s1 and close 0
s2 = s2 and downboll = 0
Hi Vicormork, i´am sorry – but it still doesn´t work. I can´t correct the error. Prorealtime still say´s Syntax Error L20 Z18. I need help. Best reagards
Hi everyone,
can someone explain these lines literaly :
if MyBoll >= 50 THEN
upBoll = X > 100
downBOLL = 0
especially the second one.
thx for all _
bonjour, comment changer les paramettre de la BB en 20 , 2.2 ?
hello, how to change BB setting to 20, 2.2 ?
Hi I was wondering if it would be possible to get an alert (by sound) when the signals shows up in the chart?
Hi, i like this bollinger moz arrwos. How can I use this indicator in an screener? I want to screen all shares with an green arrow within the last 3 bars.