[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 551

 
Roman.:

Not enough information in the question. Please reread it. Check everything.


You need to calculate the value of custom indicator "OsMA".

Writing in code

double osma1=iCustom(NULL, 0,"OsMA",12,26,9,0,1);

It should return the value of the previous candle's OsMA

but in reality it returns some wrong results.

The buffer seems to be "0", the indicator code has three parameters, written in the same order as in the indicator code, but the result is wrong.

Question: could you tell me where the error is?

 
kolospav:
All computers have META TRADER logged into the account, but only mine doesn't work :-( maybe someone can tell me what can be done? maybe something to install additionally. i just don't want to reinstall vin... I even uninstalled the firewall, i thought it was the problem, i reinstalled the program 20 times... I even uninstalled the firewall, i thought it was a problem... i uninstalled the program about 20 times...

I have a provider Ukrtelecom "OGO" (Ukraine).
 
kwadrad:


I need to calculate the value of custom indicator "OsMA".

Writing in code

It should return the value of the previous candle's OsMA

but in reality it returns some wrong results.

The buffer seems to be "0", the indicator code has three parameters, written in the same order as in the indicator code, but the result is wrong.

Question: please advise where the error is?


The name 'OsMA' is identical to the standard OsMA indicator. Are you sure you want to find the value from the custom indicator, not the standard one? If from a custom one, then change its name.
 
paladin80:
The name "OsMA" is identical to the standard OsMA indicator. Are you sure you want to find the value from the custom indicator, not the standard one? If from a custom one, then change its name.


Thanks, cool dumbass.

In MT4 it is written as a custom indicator, which is why I messed up.

 

I'm not a master.

In the simplest case, six parameters are passed to the function, right? What other parameters are passed? Is the buffer even the right one?

Check all the little things, even including the name of the indicator.

 
kwadrad:


Thank you, that's a cool dumb thing to do.

In MT4 it's written as a custom indicator, that's why I messed up.

That's okay, it happens. If you want a normal OsMA value in an EA, just use the iOsMA function.
 
Dimka-novitsek:

I seem to have forgotten how to write the function, Look, please!!!


Dimych, yo-yo, hare here laying out screenshots that are not really visible and take up a lot of space, insert the code using SCR.
 
double     Lott  ( double     Lot, double   risk ){
     if ( risk!=0)  Lot=AccountFreeMargin()*risk/100 ; return Lot;}  
 

Lot' - left parenthesis expected C:\TeleTRADE/experts/variant parametres .mq4 (392, 63)

'Lot' - semicolon expected C:\TeleTRADE/experts/qualities.mq4 (392, 63)

';' - assignment expected by C:\TeleTRADE/experts/variant parametres .mq4 (392, 66)

Swearing, parantheses and semicolon!

 
Dimka-novitsek:

Lot' - left parenthesis expected C:\TeleTRADE/experts/variant parametres .mq4 (392, 63)

'Lot' - semicolon expected C:\TeleTRADE/experts/qualities.mq4 (392, 63)

';' - assignment intended C:\TeleTRADE/experts/evaluation of the parametrameter .mq4 (392, 66)

It swears, parantheses and semicolon!

The return value should be taken in brackets:

double     Lott  ( double     Lot, double   risk ){
     if ( risk!=0)  Lot=AccountFreeMargin()*risk/100 ; return ( Lot);}