Hi Nicolas,
I have been using the Genesis Matrix indicator along with Stochastic (11, 3, 3) and ADX to confirm trend strength in a trend following scalping strategy.
The way I have this setup is as follows:
– First check trend direction on a 1h timeframe.
– Place trades on a faster timeframe in the same direction as the trend on the slower timeframe
– Genesis Matrix 5min (all boxes signalling the same colour, blue = BUY / red = SELL)
– Stochastic [11, 3, 3] 5min moving up on a buy (blue) signal and down on a sell (red) signal
– Stochastic 15min moving the same direction as on the 5min timeframe
– ADX is above 20, ideally on all 3 timeframes but at least on the 15min and 5min simultaneously.
It would be interesting to have a screener based on the above criteria. Perhaps one screener would find buy opportunities (all 4 boxes blue in the 5min TF, stochastic 5min and 15min moving up and ADX > 20) and the second screener that finds sell opportunities (all 4 boxes red in the 5min TF, stochastic 5min and 15min moving down and ADX > 20)
I also tend to use tick mode to find the best timing to enter the trades.
Please let me know your thoughts on this and thanks for taking the time to review.
Best,
Erik
Sorry for late reply, are you still requesting the screener code you described above?
Hi Nicolas,
Thanks for getting back to me. Yes I would still be interested in this screener. I’m experimenting with multi time frame strategies at the moment but fairly new to coding so I’m still learning.
Here is the code for that strategy, it embeds all conditions except the 1-hour timeframe (trend direction?) for which I don’t know how you define it?
The screener returns bullish and bearish results sorted with a number:
//PRC_Genesis Matrix | indicator
//10.09.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 indi
timeframe(15 minutes)
adx15 = ADXR[14]>20
sto15 = Stochastic[11,3](close)
sto15bull = sto15>sto15[1]
sto15bear = sto15<sto15[1]
timeframe(default)
adx5 = ADXR[14]>20
sto5 = Stochastic[11,3](close)
sto5bull = sto5>sto5[1]
sto5bear = sto5<sto5[1]
// --- settings
//TVI_Settings
TVIr=12
TVIs=12
TVIu=5
//CCI_Settings
CCIPeriod=20
//T3_Settings
T3Period=8
//GannHiLo_Settings
GannHiLoPeriod=10
// --- end of settings
result=0
//TVI (Ticks Volume Indicator)
Mypoint=pointsize
UpTicks=(Volume+(Close-Open)/MyPoint)/2
DownTicks=Volume-UpTicks
EMAUpTicks=average[TVIr,1](UpTicks)
EMADownTicks=average[TVIr,1](DownTicks)
DEMAUpTicks=average[TVIs,1](EMAUpTicks)
DEMADownTicks=average[TVIs,1](EMADownTicks)
TVIcalculate=100.0*(DEMAUpTicks-DEMADownTicks)/(DEMAUpTicks+DEMADownTicks)
TVI=average[TVIu,1](TVIcalculate)
//ProcessTVI
if TVI>=TVI[1] then
result=result+1
else
result=result-1
endif
//CCI (Commodity Channel Index)
dSig=CCI[CCIPeriod](typicalPrice)
//ProcessCCI
if dSig>0 then
result=result+1
else
result=result-1
endif
//T3
e1 = ExponentialAverage[T3Period](close)
e2 = ExponentialAverage[T3Period](e1)
e3 = ExponentialAverage[T3Period](e2)
e4 = ExponentialAverage[T3Period](e3)
e5 = ExponentialAverage[T3Period](e4)
e6 = ExponentialAverage[T3Period](e5)
b = 0.618
b2 = (b * b)
b3 = (b * b * b)
c1 = -b3
c2 = (3 * b2) + (3 * b3)
c3 = (-6 * b2) - (3 * b) - (3 * b3)
c4 = 1 + (3 * b) + b3 + (3 * b2)
avg = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3
//ProcessT3
if avg>=avg[1] then
result=result+1
else
result=result-1
endif
//GannHiLo
if Close>average[gannhiloperiod](high)[1] then
gann=1
elsif Close<average[gannhiloperiod](low)[1] then
gann=-1
endif
//ProcessGann
if gann>0 then
result=result+1
else
result=result-1
endif
bulltest = result=4 and adx5 and adx15 and sto5bull and sto15bull
beartest = result=-4 and adx5 and adx15 and sto5bear and sto15bear
if bulltest then
crit=1
else
crit=-1
endif
screener[bulltest or beartest] (crit as "bull or bear?")
bonjour
y a t il un moyen d’adapter cela à un timing journalier?
merci
iloco17 – English only in the English forums please.
@iloco17
Sure, if you want to change it to a daily-timeframe, just change the TIMEFRAME instruction:
TIMEFRAME(daily)
//PRC_Genesis Matrix | indicator
//10.09.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 indi
MinPrix = close >2.5
MinVolume = summation [10](Average[23](volume)>= 5000000)=10
//fraicheursignal = -1
//TIMEFRAME(weekly)
//adx15 = ADXR[14]>20
//sto15 = Stochastic[11,3](close)
//sto15bull = sto15>sto15[1]
//sto15bear = sto15<sto15[1]
//
//TIMEFRAME(default)
//adx5 = ADXR[14]>20
//sto5 = Stochastic[11,3](close)
//sto5bull = sto5>sto5[1]
//sto5bear = sto5<sto5[1]
// --- settings
//TVI_Settings
TVIr=12
TVIs=12
TVIu=5
//CCI_Settings
CCIPeriod=7
//T3_Settings
T3Period=8
//GannHiLo_Settings
GannHiLoPeriod=10
// --- end of settings
result=0
//TVI (Ticks Volume Indicator)
Mypoint=pointsize
UpTicks=(Volume+(Close-Open)/MyPoint)/2
DownTicks=Volume-UpTicks
EMAUpTicks=average[TVIr,1](UpTicks)
EMADownTicks=average[TVIr,1](DownTicks)
DEMAUpTicks=average[TVIs,1](EMAUpTicks)
DEMADownTicks=average[TVIs,1](EMADownTicks)
TVIcalculate=100.0*(DEMAUpTicks-DEMADownTicks)/(DEMAUpTicks+DEMADownTicks)
TVI=average[TVIu,1](TVIcalculate)
//ProcessTVI
if TVI>=TVI[1] then
result=result+1
else
result=result-1
endif
//CCI (Commodity Channel Index)
dSig=CCI[CCIPeriod](typicalPrice)
//ProcessCCI
if dSig>0 then
result=result+1
else
result=result-1
endif
//T3
e1 = ExponentialAverage[T3Period](close)
e2 = ExponentialAverage[T3Period](e1)
e3 = ExponentialAverage[T3Period](e2)
e4 = ExponentialAverage[T3Period](e3)
e5 = ExponentialAverage[T3Period](e4)
e6 = ExponentialAverage[T3Period](e5)
b = 0.618
b2 = (b * b)
b3 = (b * b * b)
c1 = -b3
c2 = (3 * b2) + (3 * b3)
c3 = (-6 * b2) - (3 * b) - (3 * b3)
c4 = 1 + (3 * b) + b3 + (3 * b2)
avg = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3
//ProcessT3
if avg>=avg[1] then
result=result+1
else
result=result-1
endif
//GannHiLo
if Close>average[gannhiloperiod](high)[1] then
gann=1
elsif Close<average[gannhiloperiod](low)[1] then
gann=-1
endif
//ProcessGann
if gann>0 then
result=result+1
else
result=result-1
endif
bulltest = result=4 and MinPrix and MinVolume //adx5 and adx15 and sto5bull and sto15bull and
beartest = result=-4 and MinPrix and MinVolume // and adx5 and adx15 and sto5bear and sto15bear and
fraicheursignal=-1
if bulltest then
// fraîcheur signal bull
IF fraicheursignal=-1 AND bulltest[1]<4 THEN
fraicheursignal = 0
ELSIF fraicheursignal=-1 AND bulltest[2]<4 THEN
fraicheursignal = 1
ELSIF fraicheursignal=-1 AND bulltest[3]<4 THEN
fraicheursignal = 2
ENDIF
else
// fraîcheur signal bear
IF fraicheursignal=-1 AND bulltest[1]>-4 THEN
fraicheursignal = 0
ENDIF
IF fraicheursignal=-1 AND bulltest[2]>-4 THEN
fraicheursignal = -1
ENDIF
IF fraicheursignal=-1 AND bulltest[3]>-4 THEN
fraicheursignal = -2
ENDIF
endif
screener[bulltest or beartest] (fraicheursignal as "bull or bear?")
Hi Nicolas,
I am trying to insert a condition on the freshness of the signal but I am missing something apparently;
Can you help us?
Best,
Chris
To be more clear, you just want to know how many bars ago the bulltest or beartest signal occurred?
Hi Nicolas,
I just realized I am not receiving by mail the answers from the posts (I don’t know if I am the only one) ; that’s why I did not answer you sorry;
In short yes this is exactly what I am willing to do 😉 thanks
You are late to the party! 😆
The below code will return results with the freshness of the detection in the sorting criteria column (minus = bearish, plus = bullish). The freshness never exceeds 4 bars ago.
//PRC_Genesis Matrix | indicator
//10.09.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 indi
timeframe(15 minutes)
adx15 = ADXR[14]>20
sto15 = Stochastic[11,3](close)
sto15bull = sto15>sto15[1]
sto15bear = sto15<sto15[1]
timeframe(default)
adx5 = ADXR[14]>20
sto5 = Stochastic[11,3](close)
sto5bull = sto5>sto5[1]
sto5bear = sto5<sto5[1]
// --- settings
//TVI_Settings
TVIr=12
TVIs=12
TVIu=5
//CCI_Settings
CCIPeriod=20
//T3_Settings
T3Period=8
//GannHiLo_Settings
GannHiLoPeriod=10
// --- end of settings
result=0
//TVI (Ticks Volume Indicator)
Mypoint=pointsize
UpTicks=(Volume+(Close-Open)/MyPoint)/2
DownTicks=Volume-UpTicks
EMAUpTicks=average[TVIr,1](UpTicks)
EMADownTicks=average[TVIr,1](DownTicks)
DEMAUpTicks=average[TVIs,1](EMAUpTicks)
DEMADownTicks=average[TVIs,1](EMADownTicks)
TVIcalculate=100.0*(DEMAUpTicks-DEMADownTicks)/(DEMAUpTicks+DEMADownTicks)
TVI=average[TVIu,1](TVIcalculate)
//ProcessTVI
if TVI>=TVI[1] then
result=result+1
else
result=result-1
endif
//CCI (Commodity Channel Index)
dSig=CCI[CCIPeriod](typicalPrice)
//ProcessCCI
if dSig>0 then
result=result+1
else
result=result-1
endif
//T3
e1 = ExponentialAverage[T3Period](close)
e2 = ExponentialAverage[T3Period](e1)
e3 = ExponentialAverage[T3Period](e2)
e4 = ExponentialAverage[T3Period](e3)
e5 = ExponentialAverage[T3Period](e4)
e6 = ExponentialAverage[T3Period](e5)
b = 0.618
b2 = (b * b)
b3 = (b * b * b)
c1 = -b3
c2 = (3 * b2) + (3 * b3)
c3 = (-6 * b2) - (3 * b) - (3 * b3)
c4 = 1 + (3 * b) + b3 + (3 * b2)
avg = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3
//ProcessT3
if avg>=avg[1] then
result=result+1
else
result=result-1
endif
//GannHiLo
if Close>average[gannhiloperiod](high)[1] then
gann=1
elsif Close<average[gannhiloperiod](low)[1] then
gann=-1
endif
//ProcessGann
if gann>0 then
result=result+1
else
result=result-1
endif
bulltest = (result=4 and adx5 and adx15 and sto5bull and sto15bull)
beartest = (result=-4 and adx5 and adx15 and sto5bear and sto15bear)
if bulltest then
crit=1
start = barindex
elsif beartest then
crit=-1
start = barindex
endif
diff = (barindex-start)*crit
test = abs(diff)<=4
screener[test] (diff as "bull or bear?")
To subscribe to a topic, there is a button at the right upper side of each first post of the topic.
😉
Thanks Nicolas; I see you are still on the dance floor 😉 !!