2 questions on codergurus course

 

the icustom function still at times is not working for me.... surely it must be i'm not accurately reflecting the custom indicators 'parameters' section of that line.... for instance, "macd" works perfect... 12,26,9..... but for something like the "fisher transform rsi", i can't get it correct....

in metastock language its always the last line of code from the custom indicator thats referenced.... how can we knowwhat line/data is being referenced in mql... for instance in macd, there are more than one line, each with a value....

and this below is from codersgurus course, what isparameter 5, range?, refering to.... is it perhaps, SetIndexStyle(0,DRAW_LINE); .....

parmeter 1 :the symbol - NULL for current symbol.

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

parmeter 3 : indicator name - here it's " Demo_Indicator".

parmeter 4 : this is a setting for Demo_Indicator - UsePeriod = 13.

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

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

like mention before, macd

double CloseBuy1_1 = iMACD(NULL, 0, 12,26,9,0,0, Current + 0);

works fine but

double BuyPreSet = iCustom(NULL, 0, "INV F T RSI v2", 0, Current + 0);

does not.... any clues to why.....

and i did at one point hard code in all external inputs variables, but still no go.....

its the inverse fisher transform of rsithat i'm having difficulty with now, can that be called by the icustom function.... thanks for your thoughts here.....h

 

buffers

forgot to mention, i also //'ed the 2nd setindex just in case it was causing the error.... its buffer 0 i'm trying to reference anyway......

and good luck tommorrow to all yall news traders.....h

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,ExtMapBuffer1);

//SetIndexStyle(1,DRAW_LINE);

//SetIndexBuffer(1,ExtMapBuffer2);

//----

return(0);

}

 

This is what the help on icustom says:

double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)

Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) and be in the terminal_directory\experts\indicators directory.

Parameters:

symbol - Symbol the data of which should be used to calculate indicator. NULL means current symbol.

timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.

name - Custom indicator compiled program name.

... - Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator.

mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions.

shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

Sample:

double val=iCustom(NULL, 0, "SampleInd",13,1,0);

13 = input required

1 = the 2nd Buffer is being called (use 0 if you want the first buffer)

0 = current bar

for the ifisher

it should be something like this

double val=iCustom(NULL,0,"iFish",0,0);

As there is no input required, that entry is skipped.

Hope this helps.

 

thanks

thanks Maji..... even though i'd read that several times along with codergurus lessons, still it for some reason was unclear.....

also i had several errors in my EA code..... it is the inverse fisher of rsi that i was trying to use, not the ifish....

with your help i figured it out....

double BuyPreset = iCustom(NULL, 0, "INV F T RSI v2", 9,0, Current + 0);

metastock language is my forte, still just now learning mql.... hope to contribute here soon.....

if the EA looks valualble i'll post it or if someone wants it in raw form, i'll post it prior to completion..... thanks again....h

Reason: