[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 278

 
forexnew:

for 3.5 minutes it turns out that there was no communication with the server.


Better to change broker/provider.
 
forexnew:

I'm repeating the question, it was left unanswered:

How do I print the request message to Print? Example log messages:

2011.10.19 13:04:11 '183927376': order buy 0.01 EURGBP opening at 0.8768 sl: 0.0000 tp: 0.8822 failed [trade timeout]

2011.10.19 13:00:52 '183927376': request in process

for 3.5 minutes it turns out that there was no connection to the server.

All error messages are displayed in my EA. However, this one remains unreactive, while I want to register the time of connection absence in seconds.

Then we could also record the overall index of the quality of connection with the server: the ratio of connection time to total time - would give a percentage index of server inactivity.

https://docs.mql4.com/check/IsConnected

bool IsConnected(), you didn't use this function, did you print it?

 
snail09:

https://docs.mql4.com/check/IsConnected

bool IsConnected(), you didn't use this function, did you print it?

On my work computer, where I'm writing on, it may pass three ticks in five minutes. My order is almost impossible to send manually because of requotes. Although I have connection almost always. (256 RAM, 800 MHz, HP SP3). I use Google-Chrome browser with 10 tabs and the CPU load is always 100%. Opened 4 charts, euro and pound, hour and minute.
I test and optimize on someone else's, that's how I got there...

ZS. Not asking a question, wondering if anyone has a weaker configuration?

 
paukas:

Record the time of the placed order

Before placing an order, check the iTime of the current bar to make sure it is higher than the recorded time.

Could you please give an example of such function for 30 min timeframe? And where it should be added to the EA? Thank you
 
snail09:

https://docs.mql4.com/check/IsConnected

bool IsConnected(), you didn't use this function, did you print it?

I will try it. Although I have it in my EA and for some reason it rarely appears in the comment.


Another question: how do I recalculate all weekends (for the entire account history) to exclude them from the profit/time ratio calculation?

 

Igor Kim (KIMIV) has some interesting features, including day of the week definitions. Why reinvent the wheel? True, they are sometimes too academic and not all of them are suitable for real life, but they are worth attention anyway.

https://www.mql5.com/ru/forum/131859

 
forexnew: Another question: how do you recalculate all weekends (throughout the account history) to exclude them from the profit-to-time ratio?

Do you do weekend trading as well? Where?

 
snail09:

Do you do weekend trading as well? Where?

Throw out an algorithm, in words, because it's a bit unclear...
 
artmedia70:

If the "twitch" MAs have crossed, check if there is already an open position with an opening time corresponding to the bar where the "twitch" MAs have crossed. If not - open.

SZZ, feed the MASHKs - maybe they're starving... :))

Please advise how to correct the opening of only one order on one bar in 30 min timeframe. Thank you

if(candle_time != Time[0])

{

candle_time = Time[0];

new_bar_buy = true;

new_bar_sell = true;

}

 
rusa:

Please advise how to fix it to open only one order on one bar.TF 30 minutes. Thank you

if(candle_time != Time[0])

{

candle_time = Time[0];

new_bar_buy = true;

new_bar_sell = true;

}

int start()
{
static datetime PrevTime=0; //penultimate bar open time

//Additional checks

if (PrevTime==0) PrevTime=Time[0]; // at first start the current bar is skipped
if (Time[0]<=PrevTime) return(0); // check the new bar open time

//--Your basic code

PrevTime=Time[0]; // memorize the zero bar open time

return(0);
}

If you have a bar open setup, here's the template, it works.