How to code? - page 161

 

to coders

would anycoder help me and put mm (risk) into a mq4 file/

i'm going to email you the file

 

Help with adding feature to EA

I am testing an EA on demo account and would to add stop loss trailing methods to it. I have a seperate ea that handles the stop loss trailing methods where you can select the one you want. Would appreciate any feedback. Thank you

 

sell EA

Hi,

I looking for a just sell EA. If you have something like that, just put it here please. I want to write a sell EA what included some indicators... thanx your help!

 

Universal MA Cross EA on FxPro Platform

Can any gracious coder/FxPro trader kindly figure out why I can't use this EA on FxPro's MT4 platform. I just can't seem to get EA to open a single trade for the life of me even with the default settings after many days.

FxPro uses the 5-digit format for their price and I've been wondering whether it's the reason. Can this be modified in the code? Someone pls help, it's slowly driving me nuts. Thanx in anticipation

 

Coding EA for base currency other than USD

Hi everyone,

Great forum :-)

I would like to know, I use money management to calculate lot size in my EA's, up until now my base currency has always been USD but could someone provide some code to calculate lot size if base currency is not USD, for example EUR etc ? Thanks in advance !

 
Pied Piper:
Can any gracious coder/FxPro trader kindly figure out why I can't use this EA on FxPro's MT4 platform. I just can't seem to get EA to open a single trade for the life of me even with the default settings after many days. FxPro uses the 5-digit format for their price and I've been wondering whether it's the reason. Can this be modified in the code? Someone pls help, it's slowly driving me nuts. Thanx in anticipation

The five digits is critical.

Mr Pip posted a solution some time ago.

"mypoint" would be a search term.

Big Be

 

Very strange error message

I am getting this error message when compiling, referencing a couple of the functions:

“no dll defined for the imported function”

I have tried moving the function way up in the EA, to check for earlier syntax errors, but no change.

Since the EA does not use dll's, and the functions are similar to other functions that do NOT get an error message, I don't have a clue.

Here is one of the functions:

int getMom_A();

{

double MomA0 = iCustom(NULL, 0, "Mom A", IndUsedByEA, MaPeriods, MaMethod, APrice, APeriods, AMethod, Mom_Length, MomOnOpen,1,0);

if (MomA0 < -0.16)

{

return(SHORT);

}

if (MomA0 > 0.16)

{

return(LONG);

}

return(FLAT);

}

(The returned variables are actually integers, defined at the beginning of the program – not the problem.)

What is going on?

Big Be

Update: Problem solved! Found answer by Google to MQL4.com.

The First line should have no semicolon, so like this:

int getMom_A()

 

Too many alerts

I wrote an indicator, and have an alert option, and when the Alert() is turned off, it prints a Comment() in the experts log.

I only want to know if the condition exists(give an alert) on the actual Close of the bar, which would be Close I thought...

However, when I run the indicator with the Alert() on, it gives me multiple alerts on the current bar while the condition is happening, and generates too many alerts.

My log file for only a couple of hours was over 35mb!

How do I fix this problem?

Please see the attached indicator, which identifies a trend continuation pattern. ( described on a trader's website: 9/30 Setup )

Thanks,

Dan

Files:
9-30-v1.mq4  5 kb
ftm.gif  17 kb
 
undertitan:
I wrote an indicator, and have an alert option, and when the Alert() is turned off, it prints a Comment() in the experts log.

I only want to know if the condition exists(give an alert) on the actual Close of the bar, which would be Close I thought...

However, when I run the indicator with the Alert() on, it gives me multiple alerts on the current bar while the condition is happening, and generates too many alerts.

My log file for only a couple of hours was over 35mb!

How do I fix this problem?

Please see the attached indicator, which identifies a trend continuation pattern. ( described on a trader's website: 9/30 Setup )

Thanks,

Dan

Try something like

int limit;

int counted_bars=IndicatorCounted();

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(int i=1; i<limit; i++)

 
leeb:
Hi everyone,

Great forum :-)

I would like to know, I use money management to calculate lot size in my EA's, up until now my base currency has always been USD but could someone provide some code to calculate lot size if base currency is not USD, for example EUR etc ? Thanks in advance !

Calculator. Forex with Alpari

Reason: