Ichimoku Strategies (General Discussion)
Forums › ProRealTime English forum › General trading discussions › Ichimoku Strategies (General Discussion)
- This topic has 10 replies, 6 voices, and was last updated 7 years ago by victormork.
-
-
08/10/2017 at 8:14 AM #42844
@volpiemanuele as requested, here the Ichimoku discussion thread. You are welcome to share your ideas related to Ichimoky trading and strategies here.
09/20/2017 at 9:10 PM #46741This is my latest Ichimoku strategy, it was optimized for the South African 40 Cash Market and the 1 Hour Timeframe:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167//Stategy: Ichimoku//Author: Juan Jacobs (Jd3gjacobs@gmail.com)//Market: South Africa 40 Cash (ZAR2 Micro)//Timezone: UTC +2//Timeframe: 1Hr//Spread: 20Defparam Cumulateorders = False//MH = (hour >= 9 or (hour = 9 and minute > x)) and (hour <= 16 or (hour = 16 and minute < 55))possize = 2//Standard Ichimoku Variables (Do not optimize)T = 9 //Tenkan-Sen Period (9)I = 26 //Chikou-Span Period (26)K = 52 //Kijun-Sen Period (52)TS = (highest[T](high)+lowest[T](low))/2 //Tenkan-SenKS = (highest[I](high)+lowest[I](low))/2 //Kijun-SenCS = close[I] //Chikou-SpanSA = (TS+KS)/2 //Senkou-Span ASB = (highest[K](high)+lowest[K](low))/2 //Senkou-Span B//Additional Criteria Variables (Can be optimized)DP = DIplus[I](close) > 20//Check strenght of Positive Directional MovementDN = DIminus[I](close) > 20 //Check strenght of Negative Directional MovementAX = ADX[20] > 10 //Check strenght of volitilityRS = RSI[2](close) //RSI Period to determine momentumPeriod = 6Deviations = 1.6PRICE = LOG(customclose)alpha = 2/(PERIOD+1)if barindex < PERIOD thenEWMA = AVERAGE[3](PRICE)elseEWMA = alpha * PRICE + (1-alpha)*EWMAendiferror = PRICE - EWMAdev = SQUARE(error)if barindex < PERIOD+1 thenvar = develsevar = alpha * dev + (1-alpha) * varendifESD = SQRT(var)Ua = EXP(EWMA + (DEVIATIONS*ESD))La = EXP(EWMA - (DEVIATIONS*ESD))Ub = Average[25,1](close)+2.5*std[25](close)Lb = Average[25,1](close)-2.5*std[25](close)BollU = (Ua + Ub)/2BollL = (La + Lb)/2BollM = EXP(EWMA)SlowEMA = Average[20,2](close)FastEMA = Average[5,2](close)MinMA = Average[2,1](close)ATR = AverageTrueRange[2](close) //Average TRue Range calculated over the last x periodsIf close[1] > open[1] ThenHighestCO = close[1]ElsIf close[1] < open[1] ThenHighestCO = open[1]EndIfIf close[1] < open[1] ThenLowestCO = close[1]ElsIf close[1] > open[1] ThenLowestCO = open[1]EndIfMaxRng = abs(open[1]-close[1])For s = 2 to 27If close[s] > open[s] ThenIf close[s] > HighestCO ThenHighestCO = close[s]EndIfElsIf close[s] < open[s] ThenIf open[s] > HighestCO ThenHighestCO = open[s]EndIfEndIfIf close[s] < open[s] ThenIf close[s] < LowestCO ThenLowestCO = close[s]EndIfElsIf close[s] > open[s] ThenIf open[s] < LowestCO ThenLowestCO = open[s]EndIfEndIfIf abs(open[s]-close[s]) > MaxRng ThenMaxRng = abs(open[s]-close[s])EndIFNextIf RSI[20](close) > RSI[20](close[I]) ThenIf close < CS ThenBDIV = 1 //Buy Divergence PresentSDIV = 0EndIfEndIfIf RSI[20](close) < RSI[20](close[I]) ThenIf close > CS ThenBDIV = 0 //Sell Divergence PresentSDIV = 1EndIfEndIf//Check for sufficient thickness of the varios Ichimoku cloud componentsKTRNG = ABS(KS - TS) > ATR*0.08ABRNG = ABS(SA - SB) > ATR*0.2ABIRNG = ABS(SA[I] - SB[I]) > ATR*0.2ABKRNG = ABS(SA[K] - SB[K]) > ATR*0.08//Check that price is not too far away from meanMDC = (ABS(KS-close) < ATR*7)//Criteria to Enter Long PositionIf countofposition = 0 and SDIV = 0 and RS > 50 and AX and DP > DN and TS > KS and SlowEMA > SlowEMA[10] and FastEMA > FastEMA[20] and MDC and KTRNG and ABKRNG and ABIRNG and ABRNG and close > SA[I] and close > SB[I] + ATR and close > CS + ATR ThenBuy possize contracts at marketoptimize = optimize + 1LE = 0EndIf//Criteria to Enter Short PositionIf countofposition = 0 and BDIV = 0 and RS < 50 and AX and DP < DN and TS < KS and SlowEMA < SlowEMA[10] and FastEMA < FastEMA[20] and MDC and KTRNG and ABKRNG and ABIRNG and ABRNG and close < SA[I] and close < SB[I]- ATR and close < CS - ATR ThenSellshort possize contracts at close - ATR stopoptimize = optimize + 1SE = 0EndIf//Exit ConditionsIf Longonmarket and ((close[2] > BollU and close[1] > BollU and close < BollU) or (high[1] > BollU and high < BollU) or (close[2] > BollM and close[1] < BollM and close < BollM)) ThenLE = 1ElsIf Shortonmarket and ((close[2] < BollL and close[1] < BollL and close > BollL) or (low[1] < BollL and Low > BollL) or (close[2] < BollM and close[1] > BollM and close > BollM)) ThenSE = 1EndIfIf Longonmarket and close[1] < KS and close[1] < FastEMA and close < KS and RS < 50 and (MinMA < MinMA[16] or FastEMA < FastEMA[22] or SlowEMA < SlowEMA[35]) or (open > BollU and close < BollU) or (close[2] > open[2] and close[2] > BollU and close[1] > open[1] and close[1] > BollU and close < open and close < BollU) or (close[1] > BollU and close < open and close < close[1]) or (high[2] > BollU and high[1] > BollU and high[1] > high[2] and high[2] > high and close[2] > open[2] and close < open) or (close[1] < open[1] and close < open and high[1] > BollU and high > BollU) or (close < LowestCO and abs(open-close) > MaxRng) ThenLE = 2ElsIf Shortonmarket and close[1] > KS and close[1] > FastEMA and close > KS and RS > 50 and (MinMA > MinMA[16] or FastEMA > FastEMA[22] or SlowEMA > SlowEMA[35]) or (open < BollL and close > BollL) or (close[2] < open[2] and close[2] < BollL and close[1] < open[1] and close[1] < BollL and close > open and close > BollL) or (close[1] < BollL and close > open and close and close > close[1]) or (low[2] < BollL and low[1] < BollL and low[1] < low[2] and low[2] > low and close[2] < open[2] and close > open) or (close[1] > open[1] and close > open and low[1] < BollL and low < BollL) or (close > HighestCO and abs(open-close) > MaxRng) ThenSE = 2EndIfIf longonmarket and ((LE = 1 and RS >= 95) or LE = 2) ThenSell at marketElsIf shortonmarket and ((SE = 1 and RS <= 5) or SE = 2) ThenExitshort at marketEndIf2 users thanked author for this post.
09/20/2017 at 9:12 PM #4674309/21/2017 at 7:25 AM #4675309/22/2017 at 8:18 AM #46884@juanj I always learn a lot from your codes so thanks for sharing! However, I have one question; don’t you find the amount of entry criteria used in the code to be a bit excessive? If you would like to explain your thoughts with regards to this I’m eager to hear 🙂
09/22/2017 at 3:44 PM #46971@victormork short answer to your question yes, I do find it excessive and therefore I do not personally trade this type of strategy live via ProOrder. All the strategies I trade live nowadays via ProOrder are very simplistic and market neutral.
However, the above strategy was designed to mimic the way I trade Ichimoku manually, other versions of the code were even more ‘excessive’ and even included Fibonacci and Pivot Levels as part of the exit criteria. When I trade Ichimoku manually I consider a lot of criteria as I usually aim to only catch the big trends and ignore the minor ones. The above was thus an attempt to automate my decision-making process when it comes to Ichimoku. Although it doesn’t even include Ichimoku Time or Wave theory as I simply do not know how to code such elements into an automated strategy.
Because of all the moving parts of this Ichimoku strategy, it obviously needs to be customized for a specific market. The above example is optimized for my local index and performs respectively.
1 user thanked author for this post.
09/22/2017 at 4:57 PM #46990I was able to trim down and simplify your code significantly. It still does the same but gets rid of about 1 1/2 page of code. You had there this FOR-loop and nested in it several IF-loops. I could trim this down to just 3 lines.
Then I did a little bit tidying up just to make it easier to read for me. Maybe somebody else likes it.
Just to make this sure. I did not change anything. I just sorted a little bit and introduced the loopback variable so you can run WFA on it – doesn’t look that bad.
I also tried to exchange all your exit conditions for a trailing SL + dynamic TP but the result was worse than with your advanced exit conditions, so I left them.
1 user thanked author for this post.
09/24/2017 at 8:18 AM #47100I used Ichimoku for many years for analysing charts and identifying entry/exit points. But I never had to modify any parameters depending on the market. The only thing I found out, was, that not every timezone is giving reliable signals. So what is the reason for this South African optimization.
Thanks for sharing your insights.
09/24/2017 at 12:45 PM #47127Hi Masala
All the standard components, parameters, and triggers of my Ichimoku strategy remains ‘unoptimized’.
However, as you would well know because Ichimoku is a trend trading strategy it can trigger many false signals when the market is simply ranging.
Therefore I have added additional parameter to weed out false signals. For example ADX strength and Divergence checks, these, however, are very dependent on the type of market and hence different parameters are required for these. As a human, you can much more easily identify trending markets and hence do not require these signal filters.
09/24/2017 at 1:49 PM #47133@juanj I’ve been trying to keep all my strategies for proorder far more simple as you said yourself, but I found your concept interesting and will study it a bit more for myself. Also I just want to thank you for adapting it on the South African index, a market that I’m normally not paying any attention to 🙂
10/26/2017 at 1:20 PM #50605Hi, I was looking over the code and divided every entry criteria on a separate line to see which of them had the largest impact on the result. I found out that a few of them didn’t really contribute so I took them out. I have not gone over the exit in detail but I’m pasting the code here if anyone else what to have a go. Btw when I tested the code I found that the short entry was too close to the market so I added a little correction for this.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212//Stategy: Ichimoku//Author: Juan Jacobs (Jd3gjacobs@gmail.com)//Market: South Africa 40 Cash (ZAR2 Micro)//Timezone: UTC +2//Timeframe: 1Hr//Spread: 20Defparam Cumulateorders = False//MH = (hour >= 9 or (hour = 9 and minute > x)) and (hour <= 16 or (hour = 16 and minute < 55))possize = 2//tradingtime = currenttime > 080000 and currenttime < 240000 // 10 och 16, 24//Standard Ichimoku Variables (Do not optimize)T = 9 //Tenkan-Sen Period (9)I = 26 //Chikou-Span Period (26)K = 52 //Kijun-Sen Period (52)TS = (highest[T](high)+lowest[T](low))/2 //Tenkan-SenKS = (highest[I](high)+lowest[I](low))/2 //Kijun-SenCS = close[I] //Chikou-SpanSA = (TS+KS)/2 //Senkou-Span ASB = (highest[K](high)+lowest[K](low))/2 //Senkou-Span B//Additional Criteria Variables (Can be optimized)DP = DIplus[I](close) > 20//Check strenght of Positive Directional MovementDN = DIminus[I](close) > 20 //Check strenght of Negative Directional MovementAX = ADX[20] > 10 //Check strenght of volitilityRS = RSI[2](close) //RSI Period to determine momentumPeriod = 6Deviations = 1.6PRICE = LOG(customclose)alpha = 2/(PERIOD+1)if barindex < PERIOD thenEWMA = AVERAGE[3](PRICE)elseEWMA = alpha * PRICE + (1-alpha)*EWMAendiferror = PRICE - EWMAdev = SQUARE(error)if barindex < PERIOD+1 thenvar = develsevar = alpha * dev + (1-alpha) * varendifESD = SQRT(var)Ua = EXP(EWMA + (DEVIATIONS*ESD))La = EXP(EWMA - (DEVIATIONS*ESD))Ub = Average[25,1](close)+2.5*std[25](close)Lb = Average[25,1](close)-2.5*std[25](close)BollU = (Ua + Ub)/2BollL = (La + Lb)/2BollM = EXP(EWMA)SlowEMA = Average[20,2](close)FastEMA = Average[5,2](close)MinMA = Average[2,1](close)ATR = AverageTrueRange[2](close) //Average TRue Range calculated over the last x periodsIf close[1] > open[1] ThenHighestCO = close[1]ElsIf close[1] < open[1] ThenHighestCO = open[1]EndIfIf close[1] < open[1] ThenLowestCO = close[1]ElsIf close[1] > open[1] ThenLowestCO = open[1]EndIfMaxRng = abs(open[1]-close[1])For s = 2 to 27If close[s] > open[s] ThenIf close[s] > HighestCO ThenHighestCO = close[s]EndIfElsIf close[s] < open[s] ThenIf open[s] > HighestCO ThenHighestCO = open[s]EndIfEndIfIf close[s] < open[s] ThenIf close[s] < LowestCO ThenLowestCO = close[s]EndIfElsIf close[s] > open[s] ThenIf open[s] < LowestCO ThenLowestCO = open[s]EndIfEndIfIf abs(open[s]-close[s]) > MaxRng ThenMaxRng = abs(open[s]-close[s])EndIFNextIf RSI[20](close) > RSI[20](close[I]) ThenIf close < CS ThenBDIV = 1 //Buy Divergence PresentSDIV = 0EndIfEndIfIf RSI[20](close) < RSI[20](close[I]) ThenIf close > CS ThenBDIV = 0 //Sell Divergence PresentSDIV = 1EndIfEndIf//Check for sufficient thickness of the varios Ichimoku cloud componentsKTRNG = ABS(KS - TS) > ATR* 0.04 //0.08ABRNG = ABS(SA - SB) > ATR*0.2ABIRNG = ABS(SA[I] - SB[I]) > ATR*0.2ABKRNG = ABS(SA[K] - SB[K]) > ATR*0.01 //0.08//Check that price is not too far away from meanMDC = (ABS(KS-close) < ATR*7)//Criteria to Enter Long PositionB1 = countofposition = 0B1 = B1 and SDIV = 0B1 = B1 and close > SA[I] and close > SB[I] + ATRB1 = B1 and RS > 50B1 = B1 and AXB1 = B1 and DP > DNB1 = B1 and TS > KSB1 = B1 and MDCB1 = B1 and KTRNGB1 = B1 and ABKRNGB1 = B1 and ABIRNGB1 = B1 and ABRNG//No diffrence//B1 = B1 and close > CS + ATR//B1 = B1 and SlowEMA > SlowEMA[10]//B1 = B1 and FastEMA > FastEMA[20]If B1 ThenBuy possize contracts at marketLE = 0EndIf//Criteria to Enter Short Positionsentry = close - ATR //make sure that stop entry is not to close to the marketIf sentry < 100 thensentry = 101endifS1 = countofposition = 0S1 = S1 and BDIV = 0S1 = S1 and close < SA[I]+ATRS1 = S1 and RS < 50S1 = S1 and AXS1 = S1 and DP < DNS1 = S1 and TS < KSS1 = S1 and MDCS1 = S1 and KTRNGS1 = S1 and ABKRNGS1 = S1 and ABIRNGS1 = S1 and ABRNGS1 = S1 and close < SB[I]- ATR// No difference//S1 = S1 and close < CS - ATR//S1 = S1 and SlowEMA < SlowEMA[10]//S1 = S1 and FastEMA < FastEMA[20]If S1 ThenSellshort possize contracts at sentry stopSE = 0EndIf//Exit ConditionsIf Longonmarket and ((close[2] > BollU and close[1] > BollU and close < BollU) or (high[1] > BollU and high < BollU) or (close[2] > BollM and close[1] < BollM and close < BollM)) ThenLE = 1ElsIf Shortonmarket and ((close[2] < BollL and close[1] < BollL and close > BollL) or (low[1] < BollL and Low > BollL) or (close[2] < BollM and close[1] > BollM and close > BollM)) ThenSE = 1EndIfIf Longonmarket and close[1] < KS and close[1] < FastEMA and close < KS and RS < 50 and (MinMA < MinMA[16] or FastEMA < FastEMA[22] or SlowEMA < SlowEMA[35]) or (open > BollU and close < BollU) or (close[2] > open[2] and close[2] > BollU and close[1] > open[1] and close[1] > BollU and close < open and close < BollU) or (close[1] > BollU and close < open and close < close[1]) or (high[2] > BollU and high[1] > BollU and high[1] > high[2] and high[2] > high and close[2] > open[2] and close < open) or (close[1] < open[1] and close < open and high[1] > BollU and high > BollU) or (close < LowestCO and abs(open-close) > MaxRng) ThenLE = 2ElsIf Shortonmarket and close[1] > KS and close[1] > FastEMA and close > KS and RS > 50 and (MinMA > MinMA[16] or FastEMA > FastEMA[22] or SlowEMA > SlowEMA[35]) or (open < BollL and close > BollL) or (close[2] < open[2] and close[2] < BollL and close[1] < open[1] and close[1] < BollL and close > open and close > BollL) or (close[1] < BollL and close > open and close and close > close[1]) or (low[2] < BollL and low[1] < BollL and low[1] < low[2] and low[2] > low and close[2] < open[2] and close > open) or (close[1] > open[1] and close > open and low[1] < BollL and low < BollL) or (close > HighestCO and abs(open-close) > MaxRng) ThenSE = 2EndIfIf longonmarket and ((LE = 1 and RS >= 95) or LE = 2 ) ThenSell at marketElsIf shortonmarket and ((SE = 1 and RS <= 5) or SE = 2 ) ThenExitshort at marketEndIfSet stop ploss 700 // (ATR * 30)*pointsize -
AuthorPosts
Find exclusive trading pro-tools on