How to code? - page 241

 
yourspace:
hi

i get an EA base on the STC_COLOR,and it can work well. but i want to add the #MTF-Schaff Trend Cycle.mq4 to the EA.

maybe there is some problem in these codes.hope someone can help me. thank you all.

........

mtfstc0 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i+2);

mtfstc1 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i+1);

mtfstc2 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i);

Hi Yourspace,

The #MTF-Schaff Trend Cycle has more settings that need to be included in the iCustom statements:

extern int TimeFrame=0;

//---- input parameters

extern int MAShort=23;

extern int MALong=50;

extern double Cycle=10;

extern int CountBars=300;

Original:

iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i);

Change To:

iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,23,50,10,300,i);

I haven't tested this but it should work...or at least get you closer to the correct answer if this is not it...

Hope this helps you,

Robert

 
kol8701:
i m using this custom MACD alert indicator, im hoping if someone can help remove the alert from this indicator below and post it on here.

Kol, can you post the mql4 file?

-guyver

 
yourspace:
hi

i get an EA base on the STC_COLOR,and it can work well. but i want to add the #MTF-Schaff Trend Cycle.mq4 to the EA. and i load the EA in the 15MIN timeframe,but it does not work,it can not order automatically.

maybe there is some problem in these codes.hope someone can help me. thank you all.

// expert start function

int start(){int j=0,limit=1;double BV=0,SV=0;BV=0;SV=0;double STC0, STC1,STC2,mtfstc0,mtfstc1,mtfstc2; // "STC0" added

if(CntO(OP_BUY,Magic)>0) TL=1;if(CntO(OP_SELL,Magic)>0) TL=-1;for(int i=1;i<=limit;i++){

STC0=iCustom(Symbol(),0,"STC_COLOR",STCPeriod,FastMAPeriod,SlowMAPeriod,0,i+2);

STC1=iCustom(Symbol(),0,"STC_COLOR",STCPeriod,FastMAPeriod,SlowMAPeriod,0,i+1);

STC2=iCustom(Symbol(),0,"STC_COLOR",STCPeriod,FastMAPeriod,SlowMAPeriod,0,i);

mtfstc0 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i+2);

mtfstc1 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i+1);

mtfstc2 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i);

string BUY="false";string SELL="false";

if((STC1STC1) && (mtfstc1mtfstc1))BUY="true";

if((STC1>STC0&&STC2mtfstc0&&mtfstc2<mtfstc1))SELL="true";

You might try this for iCustom call for Schaff Trend Cycle

mtfstc0 = iCustom(Symbol(),STCTimeframe,"Schaff Trend Cycle",25,50,10,300,0,i+2);

mtfstc1 = iCustom(Symbol(),STCTimeframe,"Schaff Trend Cycle",25,50,10,300,0,i+1);

mtfstc2 = iCustom(Symbol(),STCTimeframe,"Schaff Trend Cycle",)25,50,10,300,0,i);

Then in your external parameters ::::

extern int STCTimeframe = 15; or whatever timeframe you choose.

 
mrtools:
You might try this for iCustom call for Schaff Trend Cycle

mtfstc0 = iCustom(Symbol(),STCTimeframe,"Schaff Trend Cycle",25,50,10,300,0,i+2);

mtfstc1 = iCustom(Symbol(),STCTimeframe,"Schaff Trend Cycle",25,50,10,300,0,i+1);

mtfstc2 = iCustom(Symbol(),STCTimeframe,"Schaff Trend Cycle",)25,50,10,300,0,i);

Then in your external parameters ::::

extern int STCTimeframe = 15; or whatever timeframe you choose.

hi mrtools and cosmiclifeform

maybe it does not work, they have the same value(i==i+1==i+2),hope you can help.

yourspace

Files:
6059.jpg  64 kb
 

help

Thanks alot, i have gotten one.

Files:
 
yourspace:
hi mrtools and cosmiclifeform

maybe it does not work, they have the same value(i==i+1==i+2),hope you can help.

yourspace

Hi Yourspace,

I tried to duplicate your results and could not get the bars you show (no bars at all).

I also had trouble with another indicator your EA calls..."Leledc-T3STC_Color"...that might be causing your problems. It slowed my system and locked up a few times so I stopped testing the EA.

I saw the "Leledc-T3STC_Color" indicator mentioned having a problem in the "Bulletproof" thread...so you so you may want to look at that thread as well.

Good luck finding a solution.

Robert

 
cosmiclifeform:
Hi Yourspace,

I tried to duplicate your results and could not get the bars you show (no bars at all).

I also had trouble with another indicator your EA calls..."Leledc-T3STC_Color"...that might be causing your problems. It slowed my system and locked up a few times so I stopped testing the EA.

I saw the "Leledc-T3STC_Color" indicator mentioned having a problem in the "Bulletproof" thread...so you so you may want to look at that thread as well.

Good luck finding a solution.

Robert

hi cosmiclifeform

thank you for your help,i solve the problem. it works in 15MIN timeframe,and i set the timeframe=60.the code is like this:

mtfstc0 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i+8);

mtfstc1 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i+4);

mtfstc2 = iCustom(Symbol(),0,"#MTF-Schaff Trend Cycle",60,0,i);

then the EA can work,but it is not profitable. so i think it is useless.

 
 

hi

i meet a problem,i make an EA basing on RSX,but the EA gives many orders. maybe the code is wrong. this is the code:

RSX0=iCustom(Symbol(),0,"RSX",0,i+2);

RSX1=iCustom(Symbol(),0,"RSX",0,i+1);

RSX2=iCustom(Symbol(),0,"RSX",0,i);

string BUY="false";string SELL="false";

if((RSX1RSX1))BUY="true";

if((RSX1>RSX0)&&(RSX2<RSX1))SELL="true";

hope someone can help me.thank you very much.

yourspace

 

hi

i meet a problem,i make an EA basing on RSX,but the EA gives many orders. maybe the code is wrong. this is the code:

RSX0=iCustom(Symbol(),0,"RSX",0,i+2);

RSX1=iCustom(Symbol(),0,"RSX",0,i+1);

RSX2=iCustom(Symbol(),0,"RSX",0,i);

string BUY="false";string SELL="false";

if((RSX1RSX1))BUY="true";

if((RSX1>RSX0)&&(RSX2<RSX1))SELL="true";

hope someone can help me.thank you very much.

yourspace

Files:
6063.jpg  60 kb