MQL4 Learning - page 73

 
matrixebiz:
Ok, cool, so I can use the same command and in an EA I need to space down "/n" correct? because the comment will overwrite the IndicatorShortName correct?

Correct, with "/n" break rows.

Put on deinit()

Comment("");

to remove comment from chart when remove indicator;

 
Enforcer:
Correct, with "/n" break rows.

Put on deinit()

Comment("");

to remove comment from chart when remove indicator;

Yes, works

Thank you

 

MT4 code to know if mini or std or micro.

Been hunting this for some time now. With all the ways accounts can be set up - mini, micro, std, what code snippet can you incorporate in mq4 code so it knows the correct order to place.

For example, I want to risk only 1% of a 10,000 USD account. The logic I use results in a loss of 1000 USD however when the stop loss is hit. I figure there's something wrong with my computation of risk?

NumLotsd = NormalizeDouble((MaxCapd*MaxRisk)/(distance/Point),1);

where

distance = highest - lowest;

double highest = High,

lowest = Low;

PeriodBack can be any integer.

Thanks!

 

How to send an order when an indicator change its color?

Hi,

I a newbie in MQL4, and I need some help.

How to send an order when an indicator change its color? I`ve studied about that but I`ve not found the information. I`d like to use the color of an indicator as an entrance parameter to create a condition to send an order. Could anyone help me, please?

Regards,

 

help

I have one question about most of indicators code.

i=Bars-XPeriod-1;

i=Bars-counted_bars-1

Am I right in thinking it gives us the value of the previous candle?

Thanks in advance for answer

 

can anyone convert a script to indicator?

hello,

below is a script, and can anyone help convert this to indicator? thanks

// Output OHLCV history for surrent pair/symbol

int start() {

string fname = Symbol() + "," + Period() + ".csv";

int handle = FileOpen(fname, FILE_CSV|FILE_WRITE, ",");

if (handle>0) {

for(int i=0; i<Bars; i++) {

datetime d = Time;

d = StrToTime((TimeYear(d) - 100) + StringSubstr(TimeToStr(d),4)); // subtracts 10 years from d

string date1 = TimeToStr(d,TIME_DATE);

date1 = StringSubstr(date1,5,2) + "-" + StringSubstr(date1,8,2) + "-" + StringSubstr(date1,0,4);

string time1 = TimeToStr(d,TIME_MINUTES);

FileWrite(handle, date1, time1, Open, High, Low, Close, Volume);

}

FileClose(handle);

MessageBox("History output complete\nto file ...../experts/files/"+fname);

}

return(0);

}

 

I need help getting Started

Would someone please tell me what function or feature I can use to get historical pricing from my EA? I'm new to Forex and MQL4 and just want to get my feet wet by playing with actual prices. However I can't seem to figure out how to get them. What I want to do is compare three different sets of pricing information "open-close" for 1 minute, 5 minutes, 10 minutes" or "hours, days, weeks, etc".

 
smokinbs:
Would someone please tell me what function or feature I can use to get historical pricing from my EA? I'm new to Forex and MQL4 and just want to get my feet wet by playing with actual prices. However I can't seem to figure out how to get them. What I want to do is compare three different sets of pricing information "open-close" for 1 minute, 5 minutes, 10 minutes" or "hours, days, weeks, etc".

Not quite sure what you're asking but have you looked at iHigh, iLow, iClose etc...? You can set the time frame to use. You won't be able to get 10 m TF as it doesn't exist in MT.

Good luck

Lux

 

ea with key

can someone help me with this ea?there is a key that i have but is it not working.i have receipt and everything.is there anyone who can modify?

Files:
eakey.mq4  25 kb
 

do you have "Kernel32.dll" in library folder in experts??

Reason: