Coding an entry for when PRT bands turn from red to green?
Forums › ProRealTime English forum › ProOrder support › Coding an entry for when PRT bands turn from red to green?
- This topic has 8 replies, 4 voices, and was last updated 2 years ago by murre87.
-
-
05/26/2021 at 10:13 AM #170461
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?
05/26/2021 at 11:12 AM #170476I 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:
123// Conditions to enter long positionsindicator1 = PRTBANDSMEDIUMTERMc1 = (indicator1 > indicator1[1])1 user thanked author for this post.
05/26/2021 at 11:21 AM #170478Thank 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?
05/26/2021 at 11:47 AM #170485That 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.
05/26/2021 at 5:14 PM #170535had another look at this, the band changes colour when the candle closes above or below the upper/lower line. so the code would be:
1234567//red to greenindicator1 = PRTBANDSUPc1 = (close > indicator1)//green to redindicator2 = PRTBANDSDOWNc2 = (close < indicator2)05/26/2021 at 7:29 PM #170550Yes, 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?
05/27/2021 at 10:12 AM #170594Hi 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
endifAnd then use greentrend as one of the rules rule for order. The opposite code ofcourse for “redtrend”. Hope that helps.
1 user thanked author for this post.
05/27/2021 at 11:37 AM #17060005/28/2021 at 7:53 AM #170653 -
AuthorPosts
Find exclusive trading pro-tools on