Here is the EA using G channel as trend indicator and MTF option along with stepRSI as a pullback entry.mrtools wrote: Fri Jun 02, 2023 4:34 am Nothing if you don't want to use it in a mtf way otherwise you can put a time frame you want or maybe something like
for external parameters
and for indicator callCode: Select all
input int barsToUse = 1; enum enTimeFrames { tf_cu = 0, // Current time frame tf_m1 = PERIOD_M1, // 1 minute tf_m5 = PERIOD_M5, // 5 minutes tf_m15 = PERIOD_M15, // 15 minutes tf_m30 = PERIOD_M30, // 30 minutes tf_h1 = PERIOD_H1, // 1 hour tf_h4 = PERIOD_H4, // 4 hours tf_d1 = PERIOD_D1, // Daily tf_w1 = PERIOD_W1, // Weekly tf_mn1 = PERIOD_MN1, // Monthly tf_n1 = -1, // First higher time frame tf_n2 = -2, // Second higher time frame tf_n3 = -3 // Third higher time frame }; input enTimeFrames inpTimeFrame = tf_cu; // Time frame to use
Code: Select all
longTrend= iCustom(NULL,0,"! G Channel (mtf + alerts + arrows + candles + btn)",[b]inpTimeFrame[/b],"gc b1",200,0,0,true,2,clrRed,clrLime,true,1,3,3,6,clrMediumSeaGreen,clrOrangeRed,clrDimGray,false,false,false,false,false,false,false,2,2,10,10,1.0.1.0,clrDodgerBlue,clrSandyBrown,true,0,1,35,35,80,22,"Arial",10,clrBlack,clrDimGray,clrLime,"G Chan",14,barsToUse)
To be honest haven't done an EA this way but it should work.
I used the Buffer8 as trend filter for G channel as Buffer14 did not work.
I am attaching the indicators and EA mql4 code here.
I am still working out profitable settings but this code for G channel is working for an EA.