Hi! I’ve been trying to use PRT bands in my trading systems but have a problem with coding an entry for when the bands switches from red to green. The start of every green period is obviously when price closes above the upper band, however this occurs many times during a green period as well. I would lika a signal that only activates when it turns from red to green. Can I somehow use the color itself and if the indicator returns green or red? But how should I code that?
I don’t normally use PRT bands so someone more familiar with them may know a better way of doing this, but it looks like a change of the medium-term line mostly leads to a change in the colour zone, which means you could try this:
// Conditions to enter long positions
indicator1 = PRTBANDSMEDIUMTERM
c1 = (indicator1 > indicator1[1])
Thank you for your answer. I’ve scrolled through the graf and it seems that when PRTBANDMEDIUMTERM = PRTBANDSDOWN a color change is prompted from red to green. Could this relationship be the “secret” behind all the red to green switches?
That seems to be the case rising, but not falling.
On 1 hour DAX, the medium line turned down at 1900 yesterday but it was nowhere near the upper or lower lines. At 20:00 the colour zone turned red.
Similarly May 18 14:00
In any case, I doubt if you could use this on it’s own as an entry condition as it’s very laggy – perhaps in conjunction with some other indicator.
had another look at this, the band changes colour when the candle closes above or below the upper/lower line. so the code would be:
//red to green
indicator1 = PRTBANDSUP
c1 = (close > indicator1)
//green to red
indicator2 = PRTBANDSDOWN
c2 = (close < indicator2)
Yes, that is true. When changing from green to red that is the only condition needed.
Another issue would be to identify when price is in a “green trend”. For example that a trade can only be made if the overall trend is in “green”. We have identified how to code the switch between trends but how do we determine that the price is in the right trend; green or red?
Hi Moose
Sorry but I didnt manage to insert link, so I just write it below 🙂 If I understand your question correct I would have done the below:
if close>PRTBANDSUP then
Greentrend=1
endif
if close<PRTBANDSDOWN then
Greentrend=0
endif
And then use greentrend as one of the rules rule for order. The opposite code ofcourse for “redtrend”. Hope that helps.
Hej PastaPesto!
Yes, thank you. That is a very good solution to use 1 or 0 as the on and off switch for trends 🙂 Perfect.
Hi @Moose
I think this is a very intresting idea.
If u come up with a code i would be intressted to test it