Matrix with timeframe
Forums › ProRealTime English forum › ProOrder support › Matrix with timeframe
- This topic has 3 replies, 2 voices, and was last updated 1 year ago by robertogozzi.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
05/23/2022 at 7:12 PM #193727
I need help to fix when condlong in 180minutes, then buy if condlong in 5minutes or when it does.
If condshort the otherway around.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133DEFPARAM CUMULATEORDERS = FALSETIMEFRAME(180 minutes)CondLong = 0CondShort = 0//PRC_Genesis Matrix | indicator// --- settings//TVI_SettingsTVIr=12TVIs=12TVIu=5//CCI_SettingsCCIPeriod=20//T3_SettingsT3Period=8//GannHiLo_SettingsGannHiLoPeriod=10// --- end of settings// Set histogram positionsIDXTVI=0.25IDXCCI=0.0IDXT3=-0.25IDXGHL=-0.5//TVI (Ticks Volume Indicator)Mypoint=pointsizeUpTicks=(Volume+(Close-Open)/MyPoint)/2DownTicks=Volume-UpTicksEMAUpTicks=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//drawtext("■",barindex,IDXTVI,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXTVI,dialog,bold,20) coloured(255,0,0)//endif//CCI (Commodity Channel Index)dSig=CCI[CCIPeriod](typicalPrice)//ProcessCCI//if dSig>0 then//drawtext("■",barindex,IDXCCI,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXCCI,dialog,bold,20) coloured(255,0,0)//endif//T3e1 = 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.618b2 = (b * b)b3 = (b * b * b)c1 = -b3c2 = (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//drawtext("■",barindex,IDXT3,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXT3,dialog,bold,20) coloured(255,0,0)//endif//GannHiLoif Close>average[gannhiloperiod](high)[1] thengann=1elsif Close<average[gannhiloperiod](low)[1] thengann=-1endif//ProcessGann//if gann>0 then//drawtext("■",barindex,IDXGHL,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXGHL,dialog,bold,20) coloured(255,0,0)//endifCondLong = TVI>=TVI[1] and dSig>0 and avg>=avg[1] and gann>0CondShort = TVI<TVI[1] and dSig<0 and avg<avg[1] and gann<0TIMEFRAME(DEFAULT)IF NOT LongOnMarket AND CondLong THENBUY 1 CONTRACTS AT MARKETENDIFIF NOT ShortOnMarket AND CondShort THENSELLSHORT 1 CONTRACTS AT MARKETENDIFIf LongOnMarket AND CondShort THENSELL AT MARKETSELLSHORT 1 CONTRACTS AT MARKETENDIFIF ShortOnMarket AND CondLong THENEXITSHORT AT MARKETBUY 1 CONTRACTS AT MARKETENDIFSET STOP %LOSS 0SET TARGET %PROFIT 005/24/2022 at 7:58 AM #193756What do you want to fix?
05/24/2022 at 10:52 AM #193765Hi robertgozzi
I attached the wrong itf, this is the one i need help with.
I want it to trade if ex. condlongA appears in a condlong episode123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243DEFPARAM CUMULATEORDERS = FALSETIMEFRAME(180 minutes)CondLong = 0CondShort = 0//PRC_Genesis Matrix | indicator// --- settings//TVI_SettingsTVIr=12TVIs=12TVIu=5//CCI_SettingsCCIPeriod=20//T3_SettingsT3Period=8//GannHiLo_SettingsGannHiLoPeriod=10// --- end of settings// Set histogram positionsIDXTVI=0.25IDXCCI=0.0IDXT3=-0.25IDXGHL=-0.5//TVI (Ticks Volume Indicator)Mypoint=pointsizeUpTicks=(Volume+(Close-Open)/MyPoint)/2DownTicks=Volume-UpTicksEMAUpTicks=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//drawtext("■",barindex,IDXTVI,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXTVI,dialog,bold,20) coloured(255,0,0)//endif//CCI (Commodity Channel Index)dSig=CCI[CCIPeriod](typicalPrice)//ProcessCCI//if dSig>0 then//drawtext("■",barindex,IDXCCI,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXCCI,dialog,bold,20) coloured(255,0,0)//endif//T3e1 = 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.618b2 = (b * b)b3 = (b * b * b)c1 = -b3c2 = (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//drawtext("■",barindex,IDXT3,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXT3,dialog,bold,20) coloured(255,0,0)//endif//GannHiLoif Close>average[gannhiloperiod](high)[1] thengann=1elsif Close<average[gannhiloperiod](low)[1] thengann=-1endif//ProcessGann//if gann>0 then//drawtext("■",barindex,IDXGHL,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXGHL,dialog,bold,20) coloured(255,0,0)//endifCondLong = TVI>=TVI[1] and dSig>0 and avg>=avg[1] and gann>0CondShort = TVI<TVI[1] and dSig<0 and avg<avg[1] and gann<0TIMEFRAME(5 minutes)CondLongA = 0CondShortA = 0//PRC_Genesis Matrix | indicator// --- settings//TVI_SettingsTVIr=12TVIs=12TVIu=5//CCI_SettingsCCIPeriod=20//T3_SettingsT3Period=8//GannHiLo_SettingsGannHiLoPeriod=10// --- end of settings// Set histogram positionsIDXTVI=0.25IDXCCI=0.0IDXT3=-0.25IDXGHL=-0.5//TVI (Ticks Volume Indicator)Mypoint=pointsizeUpTicks=(Volume+(Close-Open)/MyPoint)/2DownTicks=Volume-UpTicksEMAUpTicks=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//drawtext("■",barindex,IDXTVI,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXTVI,dialog,bold,20) coloured(255,0,0)//endif//CCI (Commodity Channel Index)dSig=CCI[CCIPeriod](typicalPrice)//ProcessCCI//if dSig>0 then//drawtext("■",barindex,IDXCCI,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXCCI,dialog,bold,20) coloured(255,0,0)//endif//T3e1 = 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.618b2 = (b * b)b3 = (b * b * b)c1 = -b3c2 = (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//drawtext("■",barindex,IDXT3,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXT3,dialog,bold,20) coloured(255,0,0)//endif//GannHiLoif Close>average[gannhiloperiod](high)[1] thengann=1elsif Close<average[gannhiloperiod](low)[1] thengann=-1endif//ProcessGann//if gann>0 then//drawtext("■",barindex,IDXGHL,dialog,bold,20) coloured(0,90,255)//else//drawtext("■",barindex,IDXGHL,dialog,bold,20) coloured(255,0,0)//endifCondLong = TVI>=TVI[1] and dSig>0 and avg>=avg[1] and gann>0CondShort = TVI<TVI[1] and dSig<0 and avg<avg[1] and gann<0TIMEFRAME(DEFAULT)IF NOT LongOnMarket AND CondLong and condlongA THENBUY 1 CONTRACTS AT MARKETENDIFIF NOT ShortOnMarket AND CondShort and condshortA THENSELLSHORT 1 CONTRACTS AT MARKETENDIFIf LongOnMarket AND CondShort and condshortA THENSELL AT MARKETSELLSHORT 1 CONTRACTS AT MARKETENDIFIF ShortOnMarket AND CondLong and condlongA THENEXITSHORT AT MARKETBUY 1 CONTRACTS AT MARKETENDIFSET STOP %LOSS 0SET TARGET %PROFIT 005/30/2022 at 11:24 AM #194177Variables TVIr, TVIs and TVIu, can only be assigned values on a single timeframe (this rule applies to any variable used), still, they can be read anywhere. So you need to use different names if you want to change their value in different timeframes.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: