MT5 Programming/conversion - page 2

 

Should be something like this (untested)

double Close(int count)

{

double close[];

ArraySetAsSeries(close,true);

CopyClose(_Symbol,_Period,count,1,close);

return (close[0]);

}

Make similar functions for Open,High,Low,Volume.

 

thanks a lot but could u develop ur mind?

I think this function return only last price but what if i want use Close[100]?

Edit:

ohh i understand ur way... (but i'm not sure :P)

Unfortunatly there is no visual tester yet... i can't check to be sure

Could u analize what i wrote belowe and say is it correct? - plz -> to be sure!

if i want get Close[10] i just do Close(10) but if i want get array of 10 prices from 0 to 9 i do:

double array[10]

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

array = Close(i);

}

ohh and the last question:

in MQL4 if i testered my EAs on the chart at the begining was only about 1000 bars and i couldn't to get for example to Open[1001] -> it was equals 0

Do u know is it solved in MQL5 by Copy funcion? i mean if i start testing my EA and on the chart will be only 1000 bars can i copy 2000 Open prices?

Thanks a lot again

 

In my example to get Close[100] use Close(100).

int CopyClose(

string symbol_name, // symbol name

ENUM_TIMEFRAMES timeframe, // period

int start_pos, // start position

int count, // data count to copy

double close_array[] // target array to copy

);[/CODE]

So Close(100) will return position 100. One element is copied to array close[].

If you want to copy 10 prices from current bar (position 0) do like that

double close[];

ArraySetAsSeries(close,true);

CopyClose(_Symbol,_Period,0,10,close);

Then use close[x]

Regarding bars, you can't use values higher than history bars.

[CODE]

int bars= Bars(_Symbol, _Period); //get bars count

To get visual tester run debug mode (Press F5 in Metaeditor)

 

Thanks a lot again for help!

I'm not sure but F5 in ME doesn't work :/ or i do something wrong - i will be have to check it again later...

Enforcer:

Regarding bars, you can't use values higher than history bars.

Yes, but in normal chart (for exampl on EUR/USD) i have about 100 000 bars or more so history is very rich. At the tester is different - i have only 1000 bars (at the begining) - but its not full history what i download for this Symbol... So i thought there should be a way which give me possible to get Open[2000] or older at the begining phase of tests...

In MQL4 i had to do condition

if(Bars>5000){

//do everyghing

}

If in MQL5 is the same problem and there is no way to solve it in different way than i show over it's not sound good :/

But it's not my main problem :-)

Thank's a lot again

 

meta trader 4

most of the cases metatrader is the best

 

Jobs on MQL5.com

Use Jobs on MQL5.community. Its an easy way to contact the MQL5-developers and get your indicators in EX5. Also, its a safe way - there is a Payment System on the site and MetaQuotes is ready to be an arbitrator, if some issues occur.

 

Hello again

I have a little problem again - i mean i have a question actually 2 questions... Could u help me plz.

First of all i'd like to know why i can't create a funkcion like this:

double function (int variable = 10, double var2){

//... Error: var2 missing default value for parameter

}

[/code]

Why i have to ascribe value to variable?!

Secoundly (actually it's the most important for me) why i can't do something like that:

const int var1 = 10;

const int var2 = 5;

double array[var1]; //error

double array[var1][var2]; //more errors

it's very important for me because i will be able to do funkcjon something like this:

[code]

double function(const int var1=10, const int var2=5, double & array[][var1])

{

double mainarray[var1][var2];

//...

}

thx for answers!

Regards!

 

constant range bars for mt5

Is there a workaround for this yet? As far as I know there is no way to create a script anymore in MT5. I live and die by range bars in the market and have done so for more than a year. Anyone else have this problem or found a solution yet?

 
asnbmp999:
I am sure there are many people with this concern

but I am looking for a programmer already familiar

with mt5. I need 8-10 mt4 indicators, custom indicators,

that I have the mq4 for, of course, to be converted to

mt5 format so I am all set with that. Converted and you

tested to work exactly the same!!

If you are a good programmer, and know how to work thru

these conversions, please pm me a bid per indicator

or based upon perhaps 5 at a time that I want to convert

to be mt5 working.

If You are.....Contact at : TORONTOINDIA@HOTMAIL.COM

Please help!

Thanks

Exactly this is the kind of requirement for me also.

I need some 10 indicators that need to be converted to mt5 from mt4.

 
mezarashii:
Is there a workaround for this yet? As far as I know there is no way to create a script anymore in MT5. I live and die by range bars in the market and have done so for more than a year. Anyone else have this problem or found a solution yet?

Any substitute that ,any gentlemen have here to share for Constant range bars, for applying in MT5 PLATFORM? If any please share. Like Mezarashii, said CRB is my sole weapon for trading.

Reason: