Questions from Beginners MQL4 MT4 MetaTrader 4 - page 210

 
ponochka:
Can you tell me how to enable Alert on the close of a candle? Ie the meaning of this: The signal crossing the MA on TF 5, for example, but it is triggered somewhere in the 2nd minute, andAlert should work at the close of the current candle....

Can't the opening of a new one be checked as the previous one closed?

 

Salud!

In mt5 there is an option "Trade history", when it draws levels of closed trades (by connecting with a line opening and closing... the screenshot shows what I mean). Is there a possibility to do it programmatically in mt4, something like on/off? Or does it have to be done independently and built?


 
Yevhenii Levchenko:

On opening a new one, you can't do a check on how the previous one closed?

I don't understand! reformulate the question!

 
ponochka:

I don't understand! reformulate the question!

The closing of a candle is at the same time the opening of a new one. Do a check for new candles and on this signal check the condition
 
How can I use the mql4 script to get the number of shares I bought, let's say bac (Bank of America) and also use the script to get its current price of 26.09$. I.e., I am interested in the script getting what I can visually observe in the metatrader.
Files:
g7kp2Fucw4.png  157 kb
 
int i, eTotal=OrdersTotal();
for(i=0; i<eTotal; i++)
   {
   if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
   printf(OrderSymbol()+" : "+IntegerToString(OrderType())+" : "+DoubleToString(OrderOpenPrice(),
Digits)+" : "+DoubleToString(OrderLots(),2));
   }
 

Greetings. Can you advise me?

I am making "arbitrage" EAs, which work on two terminals from different brokers and transmit Ask and Bid to each other. I have done so by writing the structure in binary file and reading the file by another EA.

The speed of transfer is proportional to frequency of reading/writing.

How "harmful" for the disk is such a thing, if frequency is, let's say, 10 times per second?

How can you make the data transfer not through the disk?

 

Andrew, reduce the number of reads and writes to the file. If the price has not changed by more than N points, don't pass anything. This way the number of records will drop significantly. And for reading, use file-flag. If this file exists, read binary and delete file-flag. If it doesn't exist, it doesn't. From 10 times per second you get 1 time per minute

 
Andrey Sokolov:

Greetings. Can you advise me?

I am making "arbitrage" EAs, which work on two terminals from different brokers and transmit Ask and Bid to each other. I have done so by writing the structure in binary file and reading the file by another EA.

The speed of transfer is proportional to frequency of reading/writing.

How "harmful" for the disk is such a thing, if frequency is, let's say, 10 times per second?

How can you make the data transfer not through the disk?

Through shared memory. True, the religion of the dll must allow for this)