ICustom function - page 6

 

Guys,

I need some help on OzFX code from DGC...

/*---------------------*/

/* OZFX REGULAR CODE */

/*---------------------*/

OzFX_Regular[k] = 0;

if (iAC(Symbol(), 0, k) > 0 &&

iAC(Symbol(), 0, k) > iAC(Symbol(), 0, k + 1) &&

iStochastic(Symbol(), 0, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, k) > 50 )

{

if (iLastRegular != 1) OzFX_Regular[k] = 1;

iLastRegular = 1;

}

if iLastRegular is 1 it will release BUY to EA ...

Here I wanna add 1 more condition for the indicator called Lagurerre-ACS1 with settin 0.6,1000,2, trigger a buy after the indicator >0.15..

Is it something like that below..??

/*---------------------*/

/* OZFX REGULAR CODE */

/*---------------------*/

OzFX_Regular[k] = 0;

if (iAC(Symbol(), 0, k) > 0 &&

iAC(Symbol(), 0, k) > iAC(Symbol(), 0, k + 1) &&

iStochastic(Symbol(), 0, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, k) > 50 &&

iCustom(Symbol(), 0, "Laguerre-ACS1", 0.6, 1000, 2, 0, k)> 0.15)

{

if (iLastRegular != 1) OzFX_Regular[k] = 1;

iLastRegular = 1;

}

thx in advance

sonic

 
sonicdeejay:
Guys,

I need some help on OzFX code from DGC...

if iLastRegular is 1 it will release BUY to EA ...

Here I wanna add 1 more condition for the indicator called Lagurerre-ACS1 with settin 0.6,1000,2, trigger a buy after the indicator >0.15..

Is it something like that below..??

thx in advance

sonic

It seems to be OK according that the buffer called is the 1st (named 0). Guess that you know which one you need.

Just a suggestion. When you write multiple conditions, better to make them separately because in your case, even if only the first is valid, all the others are calculated each tick and then make the EA calculation heavy. Here's how you could write:

if(iAC(Symbol(), 0, k) > 0) {

if(iAC(Symbol(), 0, k) > iAC(Symbol(), 0, k + 1)) {

if(iStochastic(Symbol(), 0, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, k) > 50) {

if(iCustom(Symbol(), 0, "Laguerre-ACS1", 0.6, 1000, 2, 0, k)> 0.15) {

then your code here

}}}}

The best would be to sort the condition with the one which give the signal the lastest at the beginning of the conditions. Like this the "loop" of conditions will be calculated in full not every ticks but when almost all are valid.

Hope that helps.

FerruFx

 
FerruFx:
It seems to be OK according that the buffer called is the 1st (named 0). Guess that you know which one you need.

Just a suggestion. When you write multiple conditions, better to make them separately because in your case, even if only the first is valid, all the others are calculated each tick and then make the EA calculation heavy. Here's how you could write:

if(iAC(Symbol(), 0, k) > 0) {

if(iAC(Symbol(), 0, k) > iAC(Symbol(), 0, k + 1)) {

if(iStochastic(Symbol(), 0, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, k) > 50) {

if(iCustom(Symbol(), 0, "Laguerre-ACS1", 0.6, 1000, 2, 0, k)> 0.15) {

then your code here

}}}}

The best would be to sort the condition with the one which give the signal the lastest at the beginning of the conditions. Like this the "loop" of conditions will be calculated in full not every ticks but when almost all are valid.

Hope that helps.

FerruFx

care to help me out??

Sonic System!! - Page 16

sonic

 

A little help...

Hi i was trying to program an ea, and i followed your course (very intresting!)

I know quite well how to program in java and some c++

I was trying to program an ea with brain trend indicators the idea behind is

when brainTrend2stop and braintrend1stop DOTs are present buy (and viceversa)

but if i call the icustom function like this

BuyValueCurrent = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,1);

i get only the value of the indicator in the present bar

is there a way to make it boolean? i'd like to write a function like

buy=true

BuyCondition = (IndicatorName1=true && IndicatorName2=true);

can someone help please please please???

 
payback:
Hi i was trying to program an ea, and i followed your course (very intresting!)

I know quite well how to program in java and some c++

I was trying to program an ea with brain trend indicators the idea behind is

when brainTrend2stop and braintrend1stop DOTs are present buy (and viceversa)

but if i call the icustom function like this

BuyValueCurrent = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,1);

i get only the value of the indicator in the present bar

is there a way to make it boolean? i'd like to write a function like

buy=true

BuyCondition = (IndicatorName1=true && IndicatorName2=true);

can someone help please please please???

No need to post the same question everywhere !

 

sorry! but thx anyway!

 

Help please ... iStochastics and iCustom returning wrong values

Hi everyone,

I am running into some issues using the iStochastic function as well as the iCustom function and am hoping you can help me. With either function, the values that I get do not matchthose that I see on the chart for either the stochastic indicator or my own indicator that I am calling with the iCustom function.

What could the reason be and how can I solve this? I appreciate your assistance and thank you in advance.

 
linalm:

Hi everyone,

I am running into some issues using the iStochastic function as well as the iCustom function and am hoping you can help me. With either function, the values that I get do not matchthose that I see on the chart for either the stochastic indicator or my own indicator that I am calling with the iCustom function.

What could the reason be and how can I solve this? I appreciate your assistance and thank you in advance.

I have had some problems will the iCustom returning different values when used with the NormalizeDouble() function.

 
double Buy1_1 = iCustom(NULL, 0, "i_Trend", 0, 0, 0, 20, 2, 13, 300, 0, 0);

double Buy1_2 = iCustom(NULL, 0, "i_Trend", 0, 0, 0, 20, 2, 13, 300, 1, 0);

May I know what is the diff between these 0 and 1...

I have checked here but do not seem to understand...

iCustom - MQL4 Documentation

Thx in advacned

sonic

 
sonicdeejay:
May I know what is the diff between these 0 and 1...

I have checked here but do not seem to understand...

iCustom - MQL4 Documentation

Thx in advacned

sonic

These are the buffers # from the iTrend indicator you call.

FerruFx

Reason: