Discussion - page 15

 

Expiration Pending Order

Hi,

It would like to know of the function or routine to make that the pending orders, INDEPENDENT Of the HOUR THAT ARE PLACED, expiration the 00:00.

EXAMPLE:

Order of in Buy Stop placed to the 13:00 (expirationto the 00:00)

Order of in Sell Stop placed to the 22:00 (expiration to the 00:00)

Thanks

 

Programming question

I am new to ea programming I have been trying to add another start and stop time to firedaves universallmacross ea any ideas on how I would do this thanks for you time in advance

 

with sweat and tears

Hi

Try this

https://www.mql5.com/en/forum/general

 

extern string Time_Parameters = "------------- EA ACTIVE TIME";

extern bool UseHourTrade=false;

extern int StartHourGMT=18, EndHourGMT=24;

//----------------- TIME FILTER ---------------------//

int start()

{

if (UseHourTrade)

{

if(!(Hour()>StartHourGMT && Hour()<=EndHourGMT))

{

Comment(

"\n",">[LONG TERM] TREND BREAKOUT SYSTEM<",

"\n",

"\n", " - PROGRAM TRADING INACTIVE -",

"\n",

"\n", " - NON-TRADING HOURS! -");

return(0);

}

}

Try this! Dave <<<

 

Hello Scuba

Thanks for your reply

There is already one time filter in it much like the one you posted, but how would I put start time1 until end time1 and start time2 end time2? Does that make sense

 

Think of the program as a funnel. If the program starts and the flow runs down to the time filter, it checks to see if the GMT time is within the sleep start and stop times. If it is, let's say 20 GMT, the filter stops the flow of the program and the message appears Program Inactive. When the GMT clock advances past GMT 24, the time filter says it is ok to continue the flow of the program, and the whole program initializes and proceeds. It continues until the GMT clock once again reaches 18 GMT (start of sleep time) and the filter stops the flow of the program once again, which puts the program back into sleep mode again. This cycle repeats every day. It is an on and off switch that stops the flow of logic progression of the program coded after the time filter.

Dave <<<
 
398982:
I am new to ea programming I have been trying to add another start and stop time to firedaves universallmacross ea any ideas on how I would do this thanks for you time in advance

1. There is indicator with two starts and 2 ends. But they did it in very complicated way:

for (shift=Counted_Bars+10;shift>0;shift--)

{

on_off_trade=false;

if (TimeHour(Time[shift])>Hour_Start_1 && TimeHour(Time[shift])<Hour_End_1) on_off_trade=true;

if (TimeHour(Time[shift])==Hour_Start_1 && TimeMinute(Time[shift])>=Minute_Start_1) on_off_trade=true;

if (TimeHour(Time[shift])==Hour_End_1 && TimeMinute(Time[shift])<=Minute_End_1) on_off_trade=true;

if (TimeHour(Time[shift])>Hour_Start_2 && TimeHour(Time[shift])<Hour_End_2) on_off_trade=true;

if (TimeHour(Time[shift])==Hour_Start_2 && TimeMinute(Time[shift])>=Minute_Start_2) on_off_trade=true;

if (TimeHour(Time[shift])==Hour_End_2 && TimeMinute(Time[shift])<=Minute_End_2) on_off_trade=true;[/CODE]

And then:

if (on_off_trade)[/CODE]

and so on. But it is bery complicated.

2. I think everything can be much more easy:

[CODE]if (UseHourTrade){

if (!(Hour()>=FromHourTrade1 && Hour()<=ToHourTrade1))

{Comment("Time for trade has not come else!");

return(0);}

else if(!(Hour()>=FromHourTrade2 && Hour()<=ToHourTrade2))

{Comment("Time for trade has not come else!");

return(0);}

else if(!(Hour()>=FromHourTrade3 && Hour()<=ToHourTrade3)){

Comment("Time for trade has not come else!");

return(0);

}

}

And in the settings of EA type the following:

[CODE]extern string PARAMETERS_TIMEFILTER = "TIMEFILTER";

extern bool UseHourTrade = False;

extern int FromHourTrade1 = 8;

extern int ToHourTrade1 = 10;

extern int FromHourTrade2 = 11;

extern int ToHourTrade2 = 15;

extern int FromHourTrade3 = 19;

extern int ToHourTrade3 = 22;
Files:
 

Thanks guys for your help

 
 

need help with memory usage in MT4

Hi to all,

I am having a peculiar problem and I hope somebody can offer me some help. I have 4 M5 charts opened (eur, gbp, jpy and chf) with the cyberiatrader EA. I noticed that the ram was low on my machine and the machine is very sluggish. I have nothing else running except IBFX MT4 and the machine has 1GB ram. Before loading MT4 I check the RAM and it shows 850Mb free. Once I load MT4 with the 4 charts the ram drops to 48Mb free. The ram usage for MT4 is 780 MB!! Cleaned the log files under the /log directories and ran MT4 again..same issue. Do you have any suggestions as to what might be causing this and how it can be fixed? Thanks

Reason: