ProRealCode - Trading & Coding with ProRealTime™
Good morning!
I tried to rewrite the latest great indicator of Vonasi, Five Bar Trend Dashboard, to pro order, but failed. Any one care to elaborate what I am doing wrong, thanks!
//-------------------------------------------------------------------------
defparam cumulateorders=false
Defparam preloadbars=10000
//-------------------------------------------------------------------------
// --- settings of ORDERS
amount = 100 //quantity of shares/contracts to open for each new order
//-------------------------------------------------------------------------
//Indicators
//Indicator type: Candle trend in 5 different time frames
//Edited code originates from: Five Bar Trend
//Author: Vonasi
//Date: 20190822
//Source: https://www.prorealcode.com/prorealtime-indicators/five-bar-trend-dashboard/
m5 = customclose
//m5=typicalprice
//m5=medianprice
//m5=totalprice
//m5=weightedclose
//m5=(close or customclose = open or customclose = high or customclose = low)
m10h = highest[2](high)
m10l = lowest[2](low)
m10o = open[1]
m15h = highest[3](high)
m15l = lowest[3](low)
m15o = open[2]
m20h = highest[4](high)
m20l = lowest[4](low)
m20o = open[3]
m25h = highest[5](high)
m25l = lowest[5](low)
m25o = open[4]
if customclose = typicalprice then
m10 = (m10h + m10l + close)/3
m15 = (m15h + m15l + close)/3
m20 = (m20h + m20l + close)/3
m25 = (m25h + m25l + close)/3
endif
if customclose = medianprice then
m10 = (m10h + m10l)/2
m15 = (m15h + m15l)/2
m20 = (m20h + m20l)/2
m25 = (m25h + m25l)/2
endif
if customclose = totalprice then
m10 = (m10h + m10l + m10o + close)/4
m15 = (m15h + m15l + m15o + close)/4
m20 = (m20h + m20l + m20o + close)/4
m25 = (m25h + m25l + m25o + close)/4
endif
if customclose = weightedclose then
m10 = (m10h + m10l + (2 * close))/4
m15 = (m15h + m15l + (2 * close))/4
m20 = (m20h + m20l + (2 * close))/4
m25 = (m25h + m25l + (2 * close))/4
endif
if customclose = close or customclose = open or customclose = high or customclose = low then
m5 = open
m10 = m10o
m15 = m15o
m20 = m20o
m25 = m25o
endif
//Line 1, First time frame
//Red dot
if close < m5 then
L1=-1
down = down + 1
endif
//Green dot
if close > m5 then
L1=1
up = up + 1
endif
//Line 2, Second time frame
//Red dot
if close < m10 then
L2=-1
down = down + 1
endif
//Green dot
if close > m10 then
L2=1
up = up + 1
endif
//Line 3, Third time frame
//Red dot
if close < m15 then
L3=-1
down = down + 1
endif
//Green dot
if close > m15 then
L3=1
up = up + 1
endif
//Line 4, Fourth time frame
//Red dot
if close < m20 then
L4=-1
down = down + 1
endif
//Green dot
if close > m20 then
L4=1
up = up + 1
endif
//Line 5, Fifth time frame
//Red dot
if close < m25 then
L5=-1
down = down + 1
endif
//Green dot
if close > m25 then
L5=1
up = up + 1
endif
//Market reversal
//Down
if up[1] = 5 and down <> 5 and up <> 5 then
reda = ucount[1]
ucount = 0
Arrow=-1
endif
//Up
if down[1] = 5 and down <> 5 and up <> 5 then
greena = dcount[1]
dcount = 0
Arrow=1
endif
BullCandle5=((L1=1)and(L2=1)and(L3=1)and(L4=1)and(L5=1)) or ((Arrow=1) and (greena>=3))
BearCandle5=((L1=-1)and(L2=-1)and(L3=-1)and(L4=-1)and(L5=-1)) or ((Arrow=-1) and (reda>=3))
//Conditions when to act
if (not longonmarket and BullCandle5) then
buy amount shares at market
endif
if (longonmarket and BearCandle5 and positionperf>0) then
sell at market
endif
What is yours not doing? Maybe you are blowing your Account with Lot = 100?? 🙂
Attached with Lot = 1
Just like GraHal it works for me. I have removed all references to customclose and referenced m5 instead so that it will work with the various custom prices by // out the prices you don’t need.
//-------------------------------------------------------------------------
defparam cumulateorders=false
Defparam preloadbars=10000
//-------------------------------------------------------------------------
// --- settings of ORDERS
amount = 100 //quantity of shares/contracts to open for each new order
//-------------------------------------------------------------------------
//Indicators
//Indicator type: Candle trend in 5 different time frames
//Edited code originates from: Five Bar Trend
//Author: Vonasi
//Date: 20190822
//Source: https://www.prorealcode.com/prorealtime-indicators/five-bar-trend-dashboard/
//m5=typicalprice
m5=medianprice
//m5=totalprice
//m5=weightedclose
//m5=open
m10h = highest[2](high)
m10l = lowest[2](low)
m10o = open[1]
m15h = highest[3](high)
m15l = lowest[3](low)
m15o = open[2]
m20h = highest[4](high)
m20l = lowest[4](low)
m20o = open[3]
m25h = highest[5](high)
m25l = lowest[5](low)
m25o = open[4]
if m5 = typicalprice then
m10 = (m10h + m10l + close)/3
m15 = (m15h + m15l + close)/3
m20 = (m20h + m20l + close)/3
m25 = (m25h + m25l + close)/3
endif
if m5 = medianprice then
m10 = (m10h + m10l)/2
m15 = (m15h + m15l)/2
m20 = (m20h + m20l)/2
m25 = (m25h + m25l)/2
endif
if m5 = totalprice then
m10 = (m10h + m10l + m10o + close)/4
m15 = (m15h + m15l + m15o + close)/4
m20 = (m20h + m20l + m20o + close)/4
m25 = (m25h + m25l + m25o + close)/4
endif
if m5 = weightedclose then
m10 = (m10h + m10l + (2 * close))/4
m15 = (m15h + m15l + (2 * close))/4
m20 = (m20h + m20l + (2 * close))/4
m25 = (m25h + m25l + (2 * close))/4
endif
if m5 = open then
m5 = open
m10 = m10o
m15 = m15o
m20 = m20o
m25 = m25o
endif
//Line 1, First time frame
//Red dot
if close < m5 then
L1=-1
down = down + 1
endif
//Green dot
if close > m5 then
L1=1
up = up + 1
endif
//Line 2, Second time frame
//Red dot
if close < m10 then
L2=-1
down = down + 1
endif
//Green dot
if close > m10 then
L2=1
up = up + 1
endif
//Line 3, Third time frame
//Red dot
if close < m15 then
L3=-1
down = down + 1
endif
//Green dot
if close > m15 then
L3=1
up = up + 1
endif
//Line 4, Fourth time frame
//Red dot
if close < m20 then
L4=-1
down = down + 1
endif
//Green dot
if close > m20 then
L4=1
up = up + 1
endif
//Line 5, Fifth time frame
//Red dot
if close < m25 then
L5=-1
down = down + 1
endif
//Green dot
if close > m25 then
L5=1
up = up + 1
endif
//Market reversal
//Down
if up[1] = 5 and down <> 5 and up <> 5 then
reda = ucount[1]
ucount = 0
Arrow=-1
endif
//Up
if down[1] = 5 and down <> 5 and up <> 5 then
greena = dcount[1]
dcount = 0
Arrow=1
endif
BullCandle5=((L1=1)and(L2=1)and(L3=1)and(L4=1)and(L5=1)) or ((Arrow=1) and (greena>=3))
BearCandle5=((L1=-1)and(L2=-1)and(L3=-1)and(L4=-1)and(L5=-1)) or ((Arrow=-1) and (reda>=3))
//Conditions when to act
if (not longonmarket and BullCandle5) then
buy amount shares at market
endif
if (longonmarket and BearCandle5 and positionperf>0) then
sell at market
endif
Thank you Vonasi you solved it. I missed out to remove all references to customclose and to refere m5 instead, thanks!!
Dear Vonasi,
Now I am trying to figure out how to calculate the upper line, which I thought was dcount (down, green) or ucount (up, red). I made a simple exit condition, BearCount that you will find in the end of the code. What am I doing wrong?
//Indicator type: Candle trend in 5 different time frames
//Edited code originates from: Five Bar Trend
//Author: Vonasi
//Date: 20190822
//Source: https://www.prorealcode.com/prorealtime-indicators/five-bar-trend-dashboard/
//m5=typicalprice
m5=medianprice
//m5=totalprice
//m5=weightedclose
//m5=open
m10h = highest[2](high)
m10l = lowest[2](low)
m10o = open[1]
m15h = highest[3](high)
m15l = lowest[3](low)
m15o = open[2]
m20h = highest[4](high)
m20l = lowest[4](low)
m20o = open[3]
m25h = highest[5](high)
m25l = lowest[5](low)
m25o = open[4]
if m5 = typicalprice then
m10 = (m10h + m10l + close)/3
m15 = (m15h + m15l + close)/3
m20 = (m20h + m20l + close)/3
m25 = (m25h + m25l + close)/3
endif
if m5 = medianprice then
m10 = (m10h + m10l)/2
m15 = (m15h + m15l)/2
m20 = (m20h + m20l)/2
m25 = (m25h + m25l)/2
endif
if m5 = totalprice then
m10 = (m10h + m10l + m10o + close)/4
m15 = (m15h + m15l + m15o + close)/4
m20 = (m20h + m20l + m20o + close)/4
m25 = (m25h + m25l + m25o + close)/4
endif
if m5 = weightedclose then
m10 = (m10h + m10l + (2 * close))/4
m15 = (m15h + m15l + (2 * close))/4
m20 = (m20h + m20l + (2 * close))/4
m25 = (m25h + m25l + (2 * close))/4
endif
if m5 = open then
m5 = open
m10 = m10o
m15 = m15o
m20 = m20o
m25 = m25o
endif
//Line 1, First time frame
//Red dot
if close < m5 then
L1=-1
down = down + 1
endif
//Green dot
if close > m5 then
L1=1
up = up + 1
endif
//Line 2, Second time frame
//Red dot
if close < m10 then
L2=-1
down = down + 1
endif
//Green dot
if close > m10 then
L2=1
up = up + 1
endif
//Line 3, Third time frame
//Red dot
if close < m15 then
L3=-1
down = down + 1
endif
//Green dot
if close > m15 then
L3=1
up = up + 1
endif
//Line 4, Fourth time frame
//Red dot
if close < m20 then
L4=-1
down = down + 1
endif
//Green dot
if close > m20 then
L4=1
up = up + 1
endif
//Line 5, Fifth time frame
//Red dot
if close < m25 then
L5=-1
down = down + 1
endif
//Green dot
if close > m25 then
L5=1
up = up + 1
endif
//Calculating amount of ups eller downs reflected in first row
up = 0
down = 0
if close < m5 then
down = down + 1
endif
if close > m5 then
up = up + 1
endif
if close < m10 then
down = down + 1
endif
if close > m10 then
up = up + 1
endif
if close < m15 then
down = down + 1
endif
if close > m15 then
up = up + 1
endif
if close < m20 then
down = down + 1
endif
if close > m20 then
up = up + 1
endif
if close < m25 then
down = down + 1
endif
if close > m25 then
up = up + 1
endif
if down = 5 then
dcount = dcount + 1
ucount = 0
endif
if up = 5 then
dcount = 0
ucount = ucount + 1
endif
BearCount=dcount > 7
Sorry soulintact but I don’t fully understand what you are trying to do. The top line is just the count of bars in a row where all tests have been either all up or all tests have been down.
The only thing I can say is that if a test results in not all tests being up or not all tests being down then the following code does not reset dcount or ucount to zero.
if down = 5 then
dcount = dcount + 1
ucount = 0
endif
if up = 5 then
dcount = 0
ucount = ucount + 1
endif
BearCount=dcount > 7
Thank you Vonasi for your prompt reply. Sorry for not being clear enough.
As of the included file, I want to be able to calculate the numbers 3(green) 1 (green) 1 (red) 8 (red) 1 (red) 1 (green) 4 (green) 1 (green).
By the code I wanted to exit the position when the number of red/down was greater than 7. I enclose the code again with your suggested modification.
//Indicator type: Candle trend in 5 different time frames
//Edited code originates from: Five Bar Trend
//Author: Vonasi
//Date: 20190822
//Source: https://www.prorealcode.com/prorealtime-indicators/five-bar-trend-dashboard/
//m5=typicalprice
m5=medianprice
//m5=totalprice
//m5=weightedclose
//m5=open
m10h = highest[2](high)
m10l = lowest[2](low)
m10o = open[1]
m15h = highest[3](high)
m15l = lowest[3](low)
m15o = open[2]
m20h = highest[4](high)
m20l = lowest[4](low)
m20o = open[3]
m25h = highest[5](high)
m25l = lowest[5](low)
m25o = open[4]
if m5 = typicalprice then
m10 = (m10h + m10l + close)/3
m15 = (m15h + m15l + close)/3
m20 = (m20h + m20l + close)/3
m25 = (m25h + m25l + close)/3
endif
if m5 = medianprice then
m10 = (m10h + m10l)/2
m15 = (m15h + m15l)/2
m20 = (m20h + m20l)/2
m25 = (m25h + m25l)/2
endif
if m5 = totalprice then
m10 = (m10h + m10l + m10o + close)/4
m15 = (m15h + m15l + m15o + close)/4
m20 = (m20h + m20l + m20o + close)/4
m25 = (m25h + m25l + m25o + close)/4
endif
if m5 = weightedclose then
m10 = (m10h + m10l + (2 * close))/4
m15 = (m15h + m15l + (2 * close))/4
m20 = (m20h + m20l + (2 * close))/4
m25 = (m25h + m25l + (2 * close))/4
endif
if m5 = open then
m5 = open
m10 = m10o
m15 = m15o
m20 = m20o
m25 = m25o
endif
//Line 1, First time frame
//Red dot
if close < m5 then
L1=-1
down = down + 1
endif
//Green dot
if close > m5 then
L1=1
up = up + 1
endif
//Line 2, Second time frame
//Red dot
if close < m10 then
L2=-1
down = down + 1
endif
//Green dot
if close > m10 then
L2=1
up = up + 1
endif
//Line 3, Third time frame
//Red dot
if close < m15 then
L3=-1
down = down + 1
endif
//Green dot
if close > m15 then
L3=1
up = up + 1
endif
//Line 4, Fourth time frame
//Red dot
if close < m20 then
L4=-1
down = down + 1
endif
//Green dot
if close > m20 then
L4=1
up = up + 1
endif
//Line 5, Fifth time frame
//Red dot
if close < m25 then
L5=-1
down = down + 1
endif
//Green dot
if close > m25 then
L5=1
up = up + 1
endif
up = 0
down = 0
if close < m5 then
down = down + 1
endif
if close > m5 then
up = up + 1
endif
if close < m10 then
down = down + 1
endif
if close > m10 then
up = up + 1
endif
if close < m15 then
down = down + 1
endif
if close > m15 then
up = up + 1
endif
if close < m20 then
down = down + 1
endif
if close > m20 then
up = up + 1
endif
if close < m25 then
down = down + 1
endif
if close > m25 then
up = up + 1
endif
if down = 5 then
dcount = dcount + 1
ucount = 0
endif
if up = 5 then
dcount = 0
ucount = ucount + 1
endif
BearCount=dcount > 7
That wasn’t a suggested modification – that was the bit of your original code that I cut and pasted in where values are not set to zero at any time!
In the original code it was like this:
flag = 0
if down[1] = 5 and down <> 5 and up <> 5 then
drawtext("▲",barindex,2,SansSerif,Bold,16)coloured(0,128,0)
a = dcount[1]
drawtext("#a#",barindex,3,SansSerif,Bold,16)coloured(0,128,0)
dcount = 0
flag = 1
endif
if up[1] = 5 and down <> 5 and up <> 5 then
drawtext("▼",barindex,2,SansSerif,Bold,16)coloured(128,0,0)
a = ucount[1]
drawtext("#a#",barindex,3,SansSerif,Bold,16)coloured(128,0,0)
ucount = 0
flag = 1
endif
if flag = 0 and up <> 5 and down <> 5 then
drawtext("○",barindex,2,SansSerif,Bold,16)coloured(0,0,255)
endif
If we remove the graphics and replace them with variables then we can get something like:
flag = 0
if down[1] = 5 and down <> 5 and up <> 5 then
direction = 1
a = dcount[1]
dcount = 0
flag = 1
endif
if up[1] = 5 and down <> 5 and up <> 5 then
direction = -1
a = ucount[1]
ucount = 0
flag = 1
endif
if flag = 0 and up <> 5 and down <> 5 then
direction = 0
a = 0
endif
So now we have a variable ‘direction’ that can be either -1, zero or 1 and the variable ‘a’ which is the quantity of the same direction in a row or zero if all directions are not the same.
Thank you Vonasi for your patience!
What expression would I use to be able to “catch” the red 8, or rather 8 lines of green dots and one red dot of the following line?
I tried a few, and the following is not correct, but with the best performance: BearCount=(direction=1) and (a < 1)
What am I missing? Thanks!
//Indicator type: Candle trend in 5 different time frames
//Edited code originates from: Five Bar Trend
//Author: Vonasi
//Date: 20190822
//Source: https://www.prorealcode.com/prorealtime-indicators/five-bar-trend-dashboard/
//m5=typicalprice
m5=medianprice
//m5=totalprice
//m5=weightedclose
//m5=open
m10h = highest[2](high)
m10l = lowest[2](low)
m10o = open[1]
m15h = highest[3](high)
m15l = lowest[3](low)
m15o = open[2]
m20h = highest[4](high)
m20l = lowest[4](low)
m20o = open[3]
m25h = highest[5](high)
m25l = lowest[5](low)
m25o = open[4]
if m5 = typicalprice then
m10 = (m10h + m10l + close)/3
m15 = (m15h + m15l + close)/3
m20 = (m20h + m20l + close)/3
m25 = (m25h + m25l + close)/3
endif
if m5 = medianprice then
m10 = (m10h + m10l)/2
m15 = (m15h + m15l)/2
m20 = (m20h + m20l)/2
m25 = (m25h + m25l)/2
endif
if m5 = totalprice then
m10 = (m10h + m10l + m10o + close)/4
m15 = (m15h + m15l + m15o + close)/4
m20 = (m20h + m20l + m20o + close)/4
m25 = (m25h + m25l + m25o + close)/4
endif
if m5 = weightedclose then
m10 = (m10h + m10l + (2 * close))/4
m15 = (m15h + m15l + (2 * close))/4
m20 = (m20h + m20l + (2 * close))/4
m25 = (m25h + m25l + (2 * close))/4
endif
if m5 = open then
m5 = open
m10 = m10o
m15 = m15o
m20 = m20o
m25 = m25o
endif
//Line 1, First time frame
//Red dot
if close < m5 then
L1=-1
down = down + 1
endif
//Green dot
if close > m5 then
L1=1
up = up + 1
endif
//Line 2, Second time frame
//Red dot
if close < m10 then
L2=-1
down = down + 1
endif
//Green dot
if close > m10 then
L2=1
up = up + 1
endif
//Line 3, Third time frame
//Red dot
if close < m15 then
L3=-1
down = down + 1
endif
//Green dot
if close > m15 then
L3=1
up = up + 1
endif
//Line 4, Fourth time frame
//Red dot
if close < m20 then
L4=-1
down = down + 1
endif
//Green dot
if close > m20 then
L4=1
up = up + 1
endif
//Line 5, Fifth time frame
//Red dot
if close < m25 then
L5=-1
down = down + 1
endif
//Green dot
if close > m25 then
L5=1
up = up + 1
endif
up = 0
down = 0
if close < m5 then
down = down + 1
endif
if close > m5 then
up = up + 1
endif
if close < m10 then
down = down + 1
endif
if close > m10 then
up = up + 1
endif
if close < m15 then
down = down + 1
endif
if close > m15 then
up = up + 1
endif
if close < m20 then
down = down + 1
endif
if close > m20 then
up = up + 1
endif
if close < m25 then
down = down + 1
endif
if close > m25 then
up = up + 1
endif
flag = 0
if down[1] = 5 and down <> 5 and up <> 5 then
direction = 1
a = dcount[1]
dcount = 0
flag = 1
endif
if up[1] = 5 and down <> 5 and up <> 5 then
direction = -1
a = ucount[1]
ucount = 0
flag = 1
endif
if flag = 0 and up <> 5 and down <> 5 then
direction = 0
a = 0
endif
BearCount=(direction=1) and (a < 1)
There is a critical bit of my original indicator code that does not seem to have found its way into your code. The calculation of dcount and ucount!
if down = 5 then
dcount = dcount + 1
ucount = 0
endif
if up = 5 then
dcount = 0
ucount = ucount + 1
endif
flag = 0
if down[1] = 5 and down <> 5 and up <> 5 then
direction = 1
a = dcount[1]
dcount = 0
flag = 1
endif
if up[1] = 5 and down <> 5 and up <> 5 then
direction = -1
a = ucount[1]
ucount = 0
flag = 1
endif
if flag = 0 and up <> 5 and down <> 5 then
direction = 0
a = 0
endif
BearCount=(direction=1) and (a > 7)
Sorry about that! Although it does not work with the edited code as enclosed. Strange! Any more ideas? Thanks!
//Indicator type: Candle trend in 5 different time frames
//Edited code originates from: Five Bar Trend
//Author: Vonasi
//Date: 20190822
//Source: https://www.prorealcode.com/prorealtime-indicators/five-bar-trend-dashboard/
//m5=typicalprice
m5=medianprice
//m5=totalprice
//m5=weightedclose
//m5=open
m10h = highest[2](high)
m10l = lowest[2](low)
m10o = open[1]
m15h = highest[3](high)
m15l = lowest[3](low)
m15o = open[2]
m20h = highest[4](high)
m20l = lowest[4](low)
m20o = open[3]
m25h = highest[5](high)
m25l = lowest[5](low)
m25o = open[4]
if m5 = typicalprice then
m10 = (m10h + m10l + close)/3
m15 = (m15h + m15l + close)/3
m20 = (m20h + m20l + close)/3
m25 = (m25h + m25l + close)/3
endif
if m5 = medianprice then
m10 = (m10h + m10l)/2
m15 = (m15h + m15l)/2
m20 = (m20h + m20l)/2
m25 = (m25h + m25l)/2
endif
if m5 = totalprice then
m10 = (m10h + m10l + m10o + close)/4
m15 = (m15h + m15l + m15o + close)/4
m20 = (m20h + m20l + m20o + close)/4
m25 = (m25h + m25l + m25o + close)/4
endif
if m5 = weightedclose then
m10 = (m10h + m10l + (2 * close))/4
m15 = (m15h + m15l + (2 * close))/4
m20 = (m20h + m20l + (2 * close))/4
m25 = (m25h + m25l + (2 * close))/4
endif
if m5 = open then
m5 = open
m10 = m10o
m15 = m15o
m20 = m20o
m25 = m25o
endif
//Line 1, First time frame
//Red dot
if close < m5 then
L1=-1
down = down + 1
endif
//Green dot
if close > m5 then
L1=1
up = up + 1
endif
//Line 2, Second time frame
//Red dot
if close < m10 then
L2=-1
down = down + 1
endif
//Green dot
if close > m10 then
L2=1
up = up + 1
endif
//Line 3, Third time frame
//Red dot
if close < m15 then
L3=-1
down = down + 1
endif
//Green dot
if close > m15 then
L3=1
up = up + 1
endif
//Line 4, Fourth time frame
//Red dot
if close < m20 then
L4=-1
down = down + 1
endif
//Green dot
if close > m20 then
L4=1
up = up + 1
endif
//Line 5, Fifth time frame
//Red dot
if close < m25 then
L5=-1
down = down + 1
endif
//Green dot
if close > m25 then
L5=1
up = up + 1
endif
up = 0
down = 0
if close < m5 then
down = down + 1
endif
if close > m5 then
up = up + 1
endif
if close < m10 then
down = down + 1
endif
if close > m10 then
up = up + 1
endif
if close < m15 then
down = down + 1
endif
if close > m15 then
up = up + 1
endif
if close < m20 then
down = down + 1
endif
if close > m20 then
up = up + 1
endif
if close < m25 then
down = down + 1
endif
if close > m25 then
up = up + 1
endif
if down = 5 then
dcount = dcount + 1
ucount = 0
endif
if up = 5 then
dcount = 0
ucount = ucount + 1
endif
flag = 0
if down[1] = 5 and down <> 5 and up <> 5 then
direction = 1
a = dcount[1]
dcount = 0
flag = 1
endif
if up[1] = 5 and down <> 5 and up <> 5 then
direction = -1
a = ucount[1]
ucount = 0
flag = 1
endif
if flag = 0 and up <> 5 and down <> 5 then
direction = 0
a = 0
endif
BearCount=(direction=1) and (a > 7)
It works fine for me.
I took your code and just added ‘buy at -close limit’ to turn it into a dummy strategy. I rem’d out all references to L1, L2 etc to make it work and then graphed BEARCOUNT – having changed it to ‘BearCount=(direction=1) and (a > 3)’ and every time there is a run of more than 3 red candles it returns a positive value for BEARCOUNT.
Dear Vonasi,
Sorry for being so slow in mind and persistent, but I still do not follow fully. Do the statement below really correspond to the definition in words?
BearCount=(direction=1) and (a > 7) := (direction is now negative with a least one red dot) and (previously more than 7 of the same direction in a row of green dots)
Cheers!
No
BearCount=(direction=1) and (a > 7) would be that we have just had a run of 8 (sets of 5) red dots and this set is not a set of 5 red dots nor a set of five green dots.
Aha, thanks!
And how would we formulate the expression to “catch” the red 8 as enclosed.
Converting Five Bar Trend indicator to Pro Order
This topic contains 16 replies,
has 3 voices, and was last updated by soulintact
6 years, 5 months ago.
| Forum: | ProOrder: Automated Strategies & Backtesting |
| Language: | English |
| Started: | 08/25/2019 |
| Status: | Active |
| Attachments: | 8 files |
The information collected on this form is stored in a computer file by ProRealCode to create and access your ProRealCode profile. This data is kept in a secure database for the duration of the member's membership. They will be kept as long as you use our services and will be automatically deleted after 3 years of inactivity. Your personal data is used to create your private profile on ProRealCode. This data is maintained by SAS ProRealCode, 407 rue Freycinet, 59151 Arleux, France. If you subscribe to our newsletters, your email address is provided to our service provider "MailChimp" located in the United States, with whom we have signed a confidentiality agreement. This company is also compliant with the EU/Swiss Privacy Shield, and the GDPR. For any request for correction or deletion concerning your data, you can directly contact the ProRealCode team by email at privacy@prorealcode.com If you would like to lodge a complaint regarding the use of your personal data, you can contact your data protection supervisory authority.