This code spots, based on historical data, the day of the week where the market makes the lowest and the highest price. Being a statistical tool, this indicator helps filtering entry and exit periods but cannot be used stand alone. It’s freely inspired bu Williams’ techniques.
Buy when the red line makes a trough and sell when the blue line makes a peak. If the trend is up buy on open and sell on close, if the trend is down buy on close and sell on open.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
period=100 if dayofweek=1 then BARref=barindex refOPEN=open endif refHIGH=100*(high-refOPEN)/refOPEN refLOW=100*(-refOPEN+low)/refOPEN if barindex<BARref+4 then //lunedi if dayofweek=1 then MONhigh=refHIGH MONlow=refLOW MONcount=1 else MONhigh=0 MONlow=0 MONcount=0 endif //martedi if dayofweek=2 then TUEhigh=refHIGH TUElow=refLOW TUEcount=1 else TUEhigh=0 TUElow=0 TUEcount=0 endif //mercoledi if dayofweek=3 then WEDhigh=refHIGH WEDlow=refLOW WEDcount=1 else WEDhigh=0 WEDlow=0 WEDcount=0 endif //giovedi if dayofweek=4 then THUhigh=refHIGH THUlow=refLOW THUcount=1 else THUhigh=0 THUlow=0 THUcount=0 endif //venerdi if dayofweek=5 then FRIhigh=refHIGH FRIlow=refLOW FRIcount=1 else FRIhigh=0 FRIlow=0 FRIcount=0 endif ENDIF monALTO=summation[period](MONhigh)/summation[period](MONcount) monBASSO=summation[period](MONlow)/summation[period](MONcount) tueALTO=summation[period](TUEhigh)/summation[period](TUEcount) tueBASSO=summation[period](TUElow)/summation[period](TUEcount) wedALTO=summation[period](WEDhigh)/summation[period](WEDcount) wedBASSO=summation[period](WEDlow)/summation[period](WEDcount) thuALTO=summation[period](THUhigh)/summation[period](THUcount) thuBASSO=summation[period](THUlow)/summation[period](THUcount) friALTO=summation[period](FRIhigh)/summation[period](FRIcount) friBASSO=summation[period](FRIlow)/summation[period](FRIcount) if dayofweek=1 then refalto=monALTO refbasso=monBASSO elsif dayofweek=2 then refalto=tueALTO refbasso=tueBASSO elsif dayofweek=3 then refalto=wedALTO refbasso=wedBASSO elsif dayofweek=4 then refalto=thuALTO refbasso=thuBASSO elsif dayofweek=5 then refalto=friALTO refbasso=friBASSO endif return refalto coloured (0,0,255) as "Sell", refbasso coloured (205,0,0) as "Buy"// |
Blue skies!!
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials