ICustom function - page 18

 
OneandOnly666:
Ok! Thanks for the help, will look in to it and see if I can find the problem.

those two lines are simple conditions checking and it takes a very, very short time to test those two conditions

what is done after those lines (or in the rest of the code that depends on thos lines) is what is causing the slowdown

 
mladen:
those two lines are simple conditions checking and it takes a very, very short time to test those two conditions what is done after those lines (or in the rest of the code that depends on thos lines) is what is causing the slowdown

It was the indicator.

Used a simpler ergodic indicator instead and then it worked.

Thanks for the help, would never have found it without your assistance.

//Thomas

 
codersguru:
Hi homi,

I didn't misunderstand you. I gave you working example of iCustom.

Anyway. this is a line of code which will get the value of LSMAusing iCustom.

Note: I used LSMA in color (Lsma)

Alert(iCustom(NULL,0,"LSMA in Color",14,1500,0,0));

parmeter 1 :the symbol - NULLfor current symbol.

parmeter 2 : time frame - 0 for current time frame.

parmeter 3 : indicator name - here it's "LSMA in Color".

parmeter 4 : this is a setting for LSMA - Rperiod= 14.

parmeter 5 : this is a setting for LSMA - Draw4HowLongg= 1500.

parmeter 6 : the line number (range from 0 to 7) - usually used 0.

parmeter 7 : the working bar - 0 for the current bar.

Please try this line of code and tell me

Thanks for this

 

Hi mladen/mrtools,

Is there a thread specifically for this kind of information? I believe it will benefit non-coder members of this site.

(Ref. post #91 by Forex2006)

Thanks,

Paul

 
tamaraofx:
Re: iCustom section of Expert Advisors

Hi mladen/mrtools,

Is there a thread specifically for this kind of information? I believe it will benefit non-coder members of this site.

(Ref. post #91 by Forex2006)

Thanks,

Paul

Paul

Those are just some possible ways how those indicators can be used. You can not "cover" all the possibilities (and combinations) of how some indicators values can be used in an EA. That is why there is an iCustom() function and then we can use the indicators as we wish (or need) in an EA

And even less is there some kind of a standard how EAs work. What might work in one EA will not work in another one. There is not way how you can grab some peace of code and make all EAs work with that peace of code.

 

Yes, I noticed that. Some are basic i.e. a>b or a>0 and some complex. For the basic ones I can understand and can experiment on some ea. Sometimes it worked. There are certain ea templates where one can change indicator buy/sell signal codes and it works. Although, I'm not saying it's perfectly profitable.

You have so many good and nicely designed indicators here in this site. But how to test/automate that in an ea is not very easy for some members-including myself. As a member here, I am particularly interested to know how those nice looking indis woulld fit in an ea template; which buffer to use in the code; what are the operands and operators to use; something like that.

It would be helpful to see something like in that post for the more basic code combination for those nice looking indicators.

It's just a thought.

Thanks and best regards,

Paul

 

if the original indicator 'Dynamic zone MACD dll' in this case has buffers 0-3 then the

value '4' means another instance of this indicator and data from buffer 0 or is a coding fault/mismatch ??

Krzysztof

SetIndexBuffer(0,macd); SetIndexLabel(0,"MACD");

SetIndexBuffer(1,macs); SetIndexLabel(1,"MACD signal");

SetIndexBuffer(2,bli);

SetIndexBuffer(3,sli);

double FastMacd2 = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,0,2);

double FastMacd1 = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,0,1);

double SlowMacd = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Slow,MacdSlow_Slow,1,Slow_MacdSignalMode,Slow_MacdPrice,Slow_DzLookBackBars,Slow_DzStartBuyProbability,Slow_DzStartSellProbability,0,0);

double fast2trigger = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,4,2);

double fast1trigger = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,4,1);

double slowtrigger = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Slow,MacdSlow_Slow,1,Slow_MacdSignalMode,Slow_MacdPrice,Slow_DzLookBackBars,Slow_DzStartBuyProbability,Slow_DzStartSellProbability,4,0);

 
fajst_k:
if the original indicator 'Dynamic zone MACD dll' in this case has buffers 0-3 then the

value '4' means another instance of this indicator and data from buffer 0 or is a coding fault/mismatch ??

Krzysztof

SetIndexBuffer(0,macd); SetIndexLabel(0,"MACD");

SetIndexBuffer(1,macs); SetIndexLabel(1,"MACD signal");

SetIndexBuffer(2,bli);

SetIndexBuffer(3,sli);

double FastMacd2 = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,0,2);

double FastMacd1 = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,0,1);

double SlowMacd = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Slow,MacdSlow_Slow,1,Slow_MacdSignalMode,Slow_MacdPrice,Slow_DzLookBackBars,Slow_DzStartBuyProbability,Slow_DzStartSellProbability,0,0);

double fast2trigger = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,4,2);

double fast1trigger = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Fast,MacdSlow_Fast,1,Fast_MacdSignalMode,Fast_MacdPrice,Fast_DzLookBackBars,Fast_DzStartBuyProbability,Fast_DzStartSellProbability,4,1);

double slowtrigger = iCustom(NULL,0,"Dynamic zone MACD dll",MacdFast_Slow,MacdSlow_Slow,1,Slow_MacdSignalMode,Slow_MacdPrice,Slow_DzLookBackBars,Slow_DzStartBuyProbability,Slow_DzStartSellProbability,4,0);

Where does that code comes from?

It can not access buffer "4" since the indicator does not have it

 

from here

.........................

i was checking this code and also got suspicious but compiler don't complain

 
fajst_k:
from here i was checking this code and also got suspicious but compiler don't complain

Actually what I mean is what is the source where those iCustom() calls are used?

PS: deleted the link to that site (for obvious reasons)

Reason: