Download MetaTrader 5
To add comments, please log in or register
Hundreds of articles will help you to create a trading robot. Come and read them!
Arav007
412
Arav007 2014.04.04 04:39  
qjol:
you kidding of course it worked


Yes, it's working now.

I have used the latest version with all 10 parameters and it's working now.

Thanks.

BTW, I'm still not understanding why the Older version with 7 parameters didn't work!

As in the above image, that indicator has 8 external parameters. Here 'TimeFrame' got defined as '0' before string "xpMA".

Then I declared rest of the 7 parameters like below:

double  signal = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,3,0); 

So where I made the mistake please indicate.

Regards

Arav007
412
Arav007 2014.04.04 04:40  
deysmacro:

He has to learn from common mistakes.

Thanks for the Support and Understanding it. :)
qjol
3243
qjol 2014.04.04 09:16  
Arav007:


BTW, I'm still not understanding why the Older version with 7 parameters didn't work!

As in the above image, that indicator has 8 external parameters. Here 'TimeFrame' got defined as '0' before string "xpMA".

Then I declared rest of the 7 parameters like below:

So where I made the mistake please indicate.


let me say it again by using iCustom you have to pass the parameters corresponding with the declaration order


The passed parameters and their order must correspond with the declaration order and the type of extern variables of the custom indicator. If the values of input parameters is not specified, the default values will be used.

you CAN NOT skip a parameter

example if a custom indicator has 5 parameters you can use it like this:

double x = iCustom (Symbol(), Period(), "Name", Param1, Param2, Param3, mode, shift);

but you can not use it like this:

double x = iCustom (Symbol(), Period(), "Name", Param2, Param3, Param4, mode, shift);
Arav007
412
Arav007 2014.04.04 10:23  
qjol:


let me say it again by using iCustom you have to pass the parameters corresponding with the declaration order

you CAN NOT skip a parameter

example if a custom indicator has 5 parameters you can use it like this:

but you can not use it like this:



This is what I am doing wrong and unable to identify.

Ok, here how I have been assigning the parameters:

Param1=MA_Period

Param2=MA_Type

Param3=MA_Applied

Param4=T3MA_VolumeFactor

Param5=JMA_Phase

Param6=Step_Period

Param7=DebugMode

Now which one is wrong?

Regards

qjol
3243
qjol 2014.04.04 10:42  

you skipped the first one "TimeFrame"



Arav007
412
Arav007 2014.04.04 11:06  
qjol:


you skipped the first one "TimeFrame"




ohh, then this is the case.

If I miss any of the External Parameters it wont work.

But I skipped it consciously as it should work with the current time frame which is defined at the starting:

iCustom(Null, 0, Param1,...)

That's why I thought there is no need to define it again as 'TimeFrame'.

Thanks for the correction.

qjol
3243
qjol 2014.04.04 11:19  
Arav007:


ohh, then this is the case.

If I miss any of the External Parameters it wont work.

no, you can miss, but you cannot skip i.e. if there is 5 param. and you leave the last 2 there is no problem

but you cannot skip 1 and use 2 3 4 5

But I skipped it consciously as it should work with the current time frame which is defined at the starting:

iCustom(Null, 0, Param1,...)

yep, but the terminal doesn't know what this param contains it can contain anything (not necessarily the time frame)

That's why I thought there is no need to define it again as 'TimeFrame'.

don't think, act ! ;-)

Thanks for the correction.

whroeder1
13959
whroeder1 2014.04.04 14:03  
/ /1234
To add comments, please log in or register