Request coding for candles high / low in trend
Forums › ProRealTime English forum › ProBuilder support › Request coding for candles high / low in trend
- This topic has 5 replies, 2 voices, and was last updated 3 years ago by robertogozzi.
-
-
09/18/2021 at 1:47 PM #177843
Hi there,
I need a code for an indicator that shows the following rules. At best as a line similar to a Donchian?The following rules:
H4 timeframe
Bullish:
EMA50> EMA50 [1]
Red candle (open> close)
Lowest high of the last RED CANDLE [5]Bearish:
EMA50 <EMA50 [1]
Green candle (close> open)
highest low of the last GREEN CANDLE [5]In addition, only those candles of the respective color that are in line with the trend of the EMA specification are taken into account.
The aim is to get a stop order at the respective point (high / low) as an entry condition for a trading system.
It is important that only candles of the respective direction / color are taken into account and that the entry point is then determined.09/18/2021 at 2:02 PM #177844Here is an instructional video of the original version of Long Hang Seng. I just added some rules of my own. Maybe you can also code the original setup to see which system is better? So two versions?
Short:
Long:
09/18/2021 at 4:23 PM #177852Please:
- post your rules in details explaining what to do with it (Lowest high of the last RED CANDLE [5] isn’t clear)
- on which candle do you want the signal to be generated?
09/18/2021 at 4:59 PM #177855Hang Seng’s original setup should explain the videos well.
My setup in short:
Long: EMA50 rises, stop buy order at the high of the lowest high of the last 5 RED candles.
Short: EMA50 goes down, stop sell short order at the low of the highest low of the last 5 GREEN candles.
Attached as a picture. Sorry for the quality. Created on the smartphone.
09/18/2021 at 6:21 PM #17786209/19/2021 at 10:27 AM #177900There you go:
12345678910111213141516171819202122232425262728293031323334Offset = average[100,0](range)Ema50 = Average[50,1](close)EmaUP = Ema50 > Ema50[1]EmaDN = Ema50 < Ema50[1]Bullish = close > openBearish = close < openBulls = 0Bears = 0hh = 9999999ll = 0FOR i = 0 TO BarIndexIF Bullish[i] AND (Bulls < 5) THENBulls = Bulls + 1ll = max(ll,low[i])ENDIFIF Bearish[i] AND (Bears < 5) THENBears = Bears + 1hh = min(hh,high[i])ENDIFIF (Bulls >= 5) AND (Bears >= 5) THENBreakENDIFNEXTIF Bullish AND EmaUP THENIF close CROSSES OVER ll THENDrawArrowUP(BarIndex,low - Offset) coloured(0,128,0,150)ENDIFENDIFIF Bearish AND EmaDN THENIF close CROSSES UNDER hh THENDrawArrowDOWN(BarIndex,high + Offset) coloured(255,0,0,255)ENDIFENDIFRETURN hh coloured(255,0,0,255) style(line,2) AS "SHORT entry",ll coloured(0,128,0,140) style(line,2) AS "LONG entry"1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on