Re: Simple Expert Advisors (EA's) for MT4

421
nwesterhuijs wrote: Tue Jun 10, 2025 8:52 pm Based on the indicator my observation was that TrendSignal buffer 15 has a value of either 1 or -1.

Do be aware that this EA does not close a trade upon an opposite signal, so both a sell and buy can be open at the same time.

ALPHA BAND-EA.mq4
Hello, just to add

Code: Select all

 double lowerBand = iCustom(Symbol(), 0, "Alpha trend bands (mtf +arrows + candles + alerts)", BandPeriod, BandATRMultiplier, 0, 0);
 double upperBand = iCustom(Symbol(), 0, "Alpha trend bands (mtf +arrows + candles + alerts)", BandPeriod, BandATRMultiplier, 1, 0);
if calling the bands should be something like

Code: Select all

double lowerBand = iCustom(Symbol(),0,"Alpha trend bands (mtf + arrows + candles + alerts)", BandPeriod, BandATRMultiplier,14,0);   
double upperBand = iCustom(Symbol(),0,"Alpha trend bands (mtf + arrows + candles + alerts)", BandPeriod, BandATRMultiplier,13,0);
These users thanked the author mrtools for the post:
Ganesh


Re: Simple Expert Advisors (EA's) for MT4

422
mrtools wrote: Tue Jun 10, 2025 9:29 pm Hello, just to add

Code: Select all

 double lowerBand = iCustom(Symbol(), 0, "Alpha trend bands (mtf +arrows + candles + alerts)", BandPeriod, BandATRMultiplier, 0, 0);
 double upperBand = iCustom(Symbol(), 0, "Alpha trend bands (mtf +arrows + candles + alerts)", BandPeriod, BandATRMultiplier, 1, 0);
if calling the bands should be something like

Code: Select all

double lowerBand = iCustom(Symbol(),0,"Alpha trend bands (mtf + arrows + candles + alerts)", BandPeriod, BandATRMultiplier,14,0);   
double upperBand = iCustom(Symbol(),0,"Alpha trend bands (mtf + arrows + candles + alerts)", BandPeriod, BandATRMultiplier,13,0);
Now the EA is working for both sell and buy trades. But the EA has the following issues
1) The EA Utilizes the default settings of the indicator and not the EA settings.
2) Close all trades on opposite signal is inactive.

Please do rectify the same.

Re: Simple Expert Advisors (EA's) for MT4

423
Ganesh wrote: Tue Jun 10, 2025 10:31 pm ALPHA BAND-EA (1).mq4
Now the EA is working for both sell and buy trades. But the EA has the following issues
1) The EA Utilizes the default settings of the indicator and not the EA settings.
2) Close all trades on opposite signal is inactive.

Please do rectify the same.
1) Make sure you have your iCustom call correct and the same for the bands call and the regular Alpha trend call.
2) Far as I can tell there was never a "Close all trades on opposite signal" setting in the EA.
These users thanked the author mrtools for the post:
Ganesh

Re: Simple Expert Advisors (EA's) for MT4

424
mrtools wrote: Wed Jun 11, 2025 12:57 am 1) Make sure you have your iCustom call correct and the same for the bands call and the regular Alpha trend call.
2) Far as I can tell there was never a "Close all trades on opposite signal" setting in the EA.
1] Kindly share i Custom call
2] The EA is not closing all trades on opposite signal. kindly rectify

Re: Simple Expert Advisors (EA's) for MT4

425
Ganesh wrote: Wed Jun 11, 2025 1:26 am kindly share i Custrom call


Maybe for trend:

Code: Select all

iCustom(_Symbol, _Period, "Alpha trend bands (mtf +arrows + candles + alerts)",inp_length,inp_atr_multiplier,inpPrice,BandPeriod,BandATRMultiplier,15,BarToUse);

for bands:

Code: Select all

 double lowerBand = iCustom(_Symbol, _Period , "Alpha trend bands (mtf +arrows + candles + alerts)",inp_length,inp_atr_multiplier,inpPrice,BandPeriod,BandATRMultiplier,14,BarToUse);
 double upperBand = iCustom(_Symbol, _Period , "Alpha trend bands (mtf +arrows + candles + alerts)",inp_length,inp_atr_multiplier,inpPrice,BandPeriod,BandATRMultiplier,13,BarToUse);
These users thanked the author mrtools for the post:
Ganesh


Re: Simple Expert Advisors (EA's) for MT4

426
mrtools wrote: Wed Jun 11, 2025 1:33 am Maybe for trend:

Code: Select all

iCustom(_Symbol, _Period, "Alpha trend bands (mtf +arrows + candles + alerts)",inp_length,inp_atr_multiplier,inpPrice,BandPeriod,BandATRMultiplier,15,BarToUse);

for bands:

Code: Select all

 double lowerBand = iCustom(_Symbol, _Period , "Alpha trend bands (mtf +arrows + candles + alerts)",inp_length,inp_atr_multiplier,inpPrice,BandPeriod,BandATRMultiplier,14,BarToUse);
 double upperBand = iCustom(_Symbol, _Period , "Alpha trend bands (mtf +arrows + candles + alerts)",inp_length,inp_atr_multiplier,inpPrice,BandPeriod,BandATRMultiplier,13,BarToUse);
this is not right.

correct syntax is :

Code: Select all

iCustom(_Symbol, _Period, "Alpha trend bands (mtf +arrows + candles + alerts",0,0,"alp b1",inp_length, inp_atr_multiplier, inpPrice,   15,BarToUse);

also I think there will be an error reaching buffer 15 because it's not been defined correctly in the indi (only 14 buffers available)

EDIT : oh well it works now....
These users thanked the author ionone for the post:
Ganesh
Scalping the Century TimeFrame since 1999

Re: Simple Expert Advisors (EA's) for MT4

427
ionone wrote: Fri Jun 13, 2025 3:17 am this is not right.

correct syntax is :

Code: Select all

iCustom(_Symbol, _Period, "Alpha trend bands (mtf +arrows + candles + alerts",0,0,"alp b1",inp_length, inp_atr_multiplier, inpPrice,   15,BarToUse);

also I think there will be an error reaching buffer 15 because it's not been defined correctly in the indi (only 14 buffers available)

EDIT : oh well it works now....
Thanks, forgot to add for the mtf, in the iCustom :facepalm: , but, buffer #15 is the trend buffer #1 for uptrend and #-1 for downtrend, but if you can please show me a better way to code the indicator coloring by all means please show me.

Re: Simple Expert Advisors (EA's) for MT4

428
mrtools wrote: Fri Jun 13, 2025 3:40 am Thanks, forgot to add for the mtf but, buffer #15 is the trend buffer #1 for uptrend and #-1 for downtrend, but if you can please show me a better way to code the indicator coloring by all means please show me.
you just need to add infos for the 15th buffer
like
#property indicator_buffers 15
#property indicator_color15 DodgerBlue

etc
Scalping the Century TimeFrame since 1999

Re: Simple Expert Advisors (EA's) for MT4

430
mrtools wrote: Fri Jun 13, 2025 3:50 am Why, it is only used to give information of an uptrend or downtrend no reason to add coloring, and it is easily called by an iCustom call, if iCustom call is done correctly.
well I thought you needed to see the buffers in the property window of the indicator to be able to use the data, but apparently i'm wrong :-)
Scalping the Century TimeFrame since 1999