Coding help - page 555 1...548549550551552553554555556557558559560561562...792 New comment Mladen Rakic 2015.10.14 18:03 #5541 mntiwana:Dearest MLADEN, thanks boss,so in this case,code might be like this ? please correct me, regards =================================================================== original "simple MA cross EA" code // #define _doNothing 0 #define _doBuy 1 #define _doSell 2 int start() { int doWhat = _doNothing; double diffc = iMA(NULL,0,Ma1Period,0,Ma1Method,Ma1Price,BarToUse) -iMA(NULL,0,Ma2Period,0,Ma2Method,Ma2Price,BarToUse); double diffp = iMA(NULL,0,Ma1Period,0,Ma1Method,Ma1Price,BarToUse+1)-iMA(NULL,0,Ma2Period,0,Ma2Method,Ma2Price,BarToUse+1); if ((diffc*diffp)<0) if (diffc>0) doWhat = _doBuy; else doWhat = _doSell; if (doWhat==_doNothing) return(0); // ================================================ altered this way #define _doNothing 0 #define _doBuy 1 #define _doSell 2 int start() { int doWhat = _doNothing; double diffc = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse) -iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse); double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse==2) -iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2); if ((diffc*diffp)<0) if (diffc>0) doWhat = _doBuy; else doWhat = _doSell; if (doWhat==_doNothing) return(0); // ===================================== mntiwana Replace this : double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse==2) -iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2);[/PHP] with this : [PHP]double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse+1) -iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse+1); tfi_markets 2015.10.14 18:05 #5542 ADX Filter help Hi Pro-Coders, I would like to implement an ADX filter which shall filter sideways choppy market conditions. If the ADX is below 25 it should not open trades, I have coded this simple filter: extern int ADXPeriod=14; double CurrentADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,0); double PreviousADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,1); bool ADXfilter=false; if(CurrentADX>25&&PreviousADX<25) { ADXfilter=true; } if(ADXfilter=true) { BUY(); . . SELL(); } [/CODE] For some reason the filer is not working. I have put the ADX filter before placing the buy / sell order. Also putting it to the entry conditions signal is not working. [CODE] if(ADXfilter=true && MAFIB=="true" && BUY=="true") Could someone please advise? Thank you in advance! PipsChart iADX scripting question How can I insert Mladen Rakic 2015.10.14 18:10 #5543 tfi_markets:Hi Pro-Coders, I would like to implement an ADX filter which shall filter sideways choppy market conditions. If the ADX is below 25 it should not open trades, I have coded this simple filter: extern int ADXPeriod=14; double CurrentADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,0); double PreviousADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,1); bool ADXfilter=false; if(CurrentADX>25&&PreviousADX<25) { ADXfilter=true; } if(ADXfilter=true) { BUY(); . . SELL(); } [/CODE] For some reason the filer is not working. I have put the ADX filter before placing the buy / sell order. Also putting it to the entry conditions signal is not working. [CODE] if(ADXfilter=true && MAFIB=="true" && BUY=="true") Could someone please advise? Thank you in advance! tfi_markets Your condition will work only when adx crosses level 25 on a current bar Use simply this instead : if(CurrentADX>25) ADXfilter=true; mntiwana 2015.10.14 18:46 #5544 mladen:mntiwana Replace this : double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse==2) -iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2);[/PHP] with this : [PHP]double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse+1) -iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse+1); Dearest MLADEN, again thanks,that portion is done with your kind help,can you please advise what to add/replace in EXTERN (MA1,MA2 method) ,i pointed out in picture. regards Files: 10.png 128 kb Mladen Rakic 2015.10.14 18:48 #5545 mntiwana:Dearest MLADEN, again thanks,that portion is done with your kind help,can you please advise what to add/replace in EXTERN (MA1,MA2 method) ,i pointed out in picture. regards mntiwana You can delete the ma methods from there. They are not needed any more at all mntiwana 2015.10.14 19:00 #5546 mladen:mntiwana You can delete the ma methods from there. They are not needed any more at all Dearest MLADEN, so much thanks BOSS,for today lesson and improvement it is more than enough, regards nevar 2015.10.15 00:20 #5547 Dear All, I am looking for the sigmoid function in mql4.This is what I found so far: //--------------------------- sigmoid() --------------------------------- // 1/(1+exp(-x)) double sigmoid(double x) { if (x>50) return (1); if (x<-50) return (0); return (1.0/(1.0+MathExp(-x))); }//sigmoid() https://www.mql5.com/en/code/9002 and this debate neural network - Fast sigmoid algorithm - Stack Overflow Can anyone help?Thanks. Machine learning in trading: Question on neural network Jurik Mladen Rakic 2015.10.15 06:19 #5548 nevar:Dear All, I am looking for the sigmoid function in mql4.This is what I found so far: //--------------------------- sigmoid() --------------------------------- // 1/(1+exp(-x)) double sigmoid(double x) { if (x>50) return (1); if (x<-50) return (0); return (1.0/(1.0+MathExp(-x))); }//sigmoid() https://www.mql5.com/en/code/9002 and this debate neural network - Fast sigmoid algorithm - Stack Overflow Can anyone help?Thanks. nevar one was used here : https://www.mql5.com/en/forum/179686/page13 aras2580 2015.10.15 10:33 #5549 hi mladen ....wowww its better than my indicator.....you are the best..many thanks your help.....many many thank you very much.....sincerely... [Deleted] 2015.10.16 06:02 #5550 HI mladen, did you guys find the bug in my code? Thanks 1...548549550551552553554555556557558559560561562...792 New comment
Dearest MLADEN,
thanks boss,so in this case,code might be like this ? please correct me,
regards
===================================================================
original "simple MA cross EA" code
//
#define _doNothing 0
#define _doBuy 1
#define _doSell 2
int start()
{
int doWhat = _doNothing;
double diffc = iMA(NULL,0,Ma1Period,0,Ma1Method,Ma1Price,BarToUse) -iMA(NULL,0,Ma2Period,0,Ma2Method,Ma2Price,BarToUse);
double diffp = iMA(NULL,0,Ma1Period,0,Ma1Method,Ma1Price,BarToUse+1)-iMA(NULL,0,Ma2Period,0,Ma2Method,Ma2Price,BarToUse+1);
if ((diffc*diffp)<0)
if (diffc>0)
doWhat = _doBuy;
else doWhat = _doSell;
if (doWhat==_doNothing) return(0);
//
================================================
altered this way
#define _doNothing 0
#define _doBuy 1
#define _doSell 2
int start()
{
int doWhat = _doNothing;
double diffc = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse)
-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse);
double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse==2)
-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2);
if ((diffc*diffp)<0)
if (diffc>0)
doWhat = _doBuy;
else doWhat = _doSell;
if (doWhat==_doNothing) return(0);
//
=====================================mntiwana
Replace this :
-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2);[/PHP]
with this :
[PHP]double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse+1)
-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse+1);ADX Filter help
Hi Pro-Coders,
I would like to implement an ADX filter which shall filter sideways choppy market conditions.
If the ADX is below 25 it should not open trades, I have coded this simple filter:
extern int ADXPeriod=14;
double CurrentADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,0);
double PreviousADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,1);
bool ADXfilter=false;
if(CurrentADX>25&&PreviousADX<25)
{
ADXfilter=true;
}
if(ADXfilter=true)
{
BUY();
.
.
SELL();
}
[/CODE]
For some reason the filer is not working. I have put the ADX filter before placing the buy / sell order.
Also putting it to the entry conditions signal is not working.
[CODE]
if(ADXfilter=true && MAFIB=="true" && BUY=="true")
Could someone please advise? Thank you in advance!
Hi Pro-Coders,
I would like to implement an ADX filter which shall filter sideways choppy market conditions.
If the ADX is below 25 it should not open trades, I have coded this simple filter:
extern int ADXPeriod=14;
double CurrentADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,0);
double PreviousADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,1);
bool ADXfilter=false;
if(CurrentADX>25&&PreviousADX<25)
{
ADXfilter=true;
}
if(ADXfilter=true)
{
BUY();
.
.
SELL();
}
[/CODE]
For some reason the filer is not working. I have put the ADX filter before placing the buy / sell order.
Also putting it to the entry conditions signal is not working.
[CODE]
if(ADXfilter=true && MAFIB=="true" && BUY=="true")
tfi_markets
Your condition will work only when adx crosses level 25 on a current bar
Use simply this instead :
if(CurrentADX>25) ADXfilter=true;
mntiwana
Replace this :
-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2);[/PHP]
with this :
[PHP]double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse+1)
-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse+1);Dearest MLADEN,
again thanks,that portion is done with your kind help,can you please advise what to add/replace in EXTERN (MA1,MA2 method) ,i pointed out in picture.
regards
Dearest MLADEN,
again thanks,that portion is done with your kind help,can you please advise what to add/replace in EXTERN (MA1,MA2 method) ,i pointed out in picture.
regardsmntiwana
You can delete the ma methods from there. They are not needed any more at all
mntiwana You can delete the ma methods from there. They are not needed any more at all
Dearest MLADEN,
so much thanks BOSS,for today lesson and improvement it is more than enough,

regards
Dear All,
I am looking for the sigmoid function in mql4.This is what I found so far:
//--------------------------- sigmoid() ---------------------------------
// 1/(1+exp(-x))
double sigmoid(double x)
{
if (x>50) return (1);
if (x<-50) return (0);
return (1.0/(1.0+MathExp(-x)));
}//sigmoid()
https://www.mql5.com/en/code/9002 and this debate neural network - Fast sigmoid algorithm - Stack Overflow
Can anyone help?Thanks.
Dear All,
I am looking for the sigmoid function in mql4.This is what I found so far:
//--------------------------- sigmoid() ---------------------------------
// 1/(1+exp(-x))
double sigmoid(double x)
{
if (x>50) return (1);
if (x<-50) return (0);
return (1.0/(1.0+MathExp(-x)));
}//sigmoid()
https://www.mql5.com/en/code/9002 and this debate neural network - Fast sigmoid algorithm - Stack Overflow
Can anyone help?Thanks.nevar
one was used here : https://www.mql5.com/en/forum/179686/page13
hi mladen ....wowww its better than my indicator.....you are the best..many thanks your help.....many many thank you very much.....sincerely...
HI mladen,
did you guys find the bug in my code?
Thanks