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

 
orb:

Suppose EURUSD=1.44757, GBPUSD=1.63366, you want them to be close to each other.

Let me explain:

a=GBPUSD/EURUSD=1.12855336874901 approximately 1.12855 ,

i.e. if I want to buy/sell a currency so that the deal is approximately equal in value, then

I need to buy/sell EURUSD*a, but there is no such a lot, so my question is how to implement it, lot calculation?

I don't know what the problem is.

What is the problem?

If for GBPUSD the volume in lots is equal to lots, then for EURUSD you have to multiply by a, i.e. GBPUSD / EURUSD. And don't forget to normalize before inserting the volumes into a trade order.

 
jurist70:

Need Help!

I have the following block in my EA (Event Counter):

if (isCloseLastPosByStop()==True) //If the last order was closed by Stop

{
N=N+1;
Alert(N, " moose");
} else N=0;

QUESTION: instead of displaying the information on the screen, how do I write the data into a file (Excel)?



  // Create file in CSV format and save its handle int handle = FileOpen("filename.csv", FILE_CSV|FILE_WRITE, ';'); if(handle > 0) { // If file created FileWrite(handle, N, "moose"); // Write into file FileClose(handle); // Close file } ... // Open file in Excel
 
Reshetov:

What's the problem, I don't understand?

If for GBPUSD the volume in lots is equal to lots, for EURUSD lots should be multiplied by a, i.e. GBPUSD / EURUSD. And do not forget about normalization, before adding volumes to your trade order.

I thought lots were only fixed, 0.01; 1; 2 I'm a beginner in general! 2 Reshetov, thank you!)
 
Hello all, how to work with DDE Sample, what it is in general, in general, explain please? I opened this file - DDE-Sample.xls nothing happens, what is it for?
 
fore-x:
Hi all, how to work with DDE Sample, what it is in general, in general, explain please? I opened this file - DDE-Sample.xls nothing happens, why is it needed?

It is necessary to enable DDE in MT4 settings. In the table the price values will start to change with the arrival of new ticks.

This is for those who like to program in Excel. Well, it is also a way to receive all ticks from MT4, unless, of course, the connection is broken. I.e. you can have all the ticks. Even from packs.

 
Zhunko:

It is necessary to enable DDE in MT4 settings. In the table the price values will start to change with the arrival of new ticks.

This is for those who like to program in Excel.

I have it enabled, but - alas, nothing changes.

I also found such a topic - "how to catch every tick?", I remove the question, because of lack of interest in digging in this direction. (smiley face) :)

 
fore-x:

I have it enabled, but - alas, nothing changes.

Also found here such a topic - "how to catch every tick?", I remove the question, due to lack of interest in digging in this direction. (smiley face) :)

Have you read the MT4 help? Try to do everything as it says there.

Export quotes

The initial data on which all analytical work of the terminal user is based is the information about price dynamics of financial instruments. This information is provided by a brokerage company. The price data allow drawing the charts of financial instruments, researching financial markets, using various trade strategies and making trade decisions. Quotations are the files with the records in the format "SYMBOL, BID, ASK, DATE" (financial instrument, buy price, sell price, date and time) and come to the terminal automatically after connection with server.

The terminal allows exporting current quotes to other programs in real time using the "DDE" (Dynamic Data Exchange) protocol. This is a protocol of MS Windows operating systems for dynamic data exchange between different applications. Quotes in DDE are output only when new ticks arrive (ADVISE mode) and not immediately upon request (REQUEST mode) with output of the last known price. N/A is issued at the first REQUEST request, and quotes appear after the arrival of the new price.

To activate quotation export mode from the client terminal via DDE protocol, enable the "Enable DDE server" option in the terminal settings.

Attention: Historical data are not transmitted using the DDE protocol. The current quotes are transmitted only when the client terminal is working.

Formats of DDE-requests with their possible results on the example of "DDE-sample.xls" file:

   request BID: = MT4|BID!USDCHF result: 1.5773 request ASK: = MT4|ASK!USDCHF result: 1.5778 request HIGH: = MT4|HIGH!USDCHF result: 1.5801 request LOW: = MT4|LOW!USDCHF result: 1.5741 request TIME: = MT4|TIME!USDCHF result: 21.05.02 9:52 request QUOTE: = MT4|QUOTE!USDCHF result: 21.05.02 9:52 1.5773 1.5778 1.5776

Attention: To display data correctly in MS Excel, you have to enable the option in the menu "Tools - Options - Transition - Convert formulas to Excel format when entering".
 
Zhunko:

Have you read the MT4 help? Try to do everything as it says there.

Yay, it's working!


 

Good afternoon!!! Here's how google,yandex mql4 can a variable be colour coded in the meta-editor? In the first six pages there is no desired answer.

So, is it possible? Very interesting!

 

Hi, help me please, I can't see the most obvious thing((((

double LotsAllPos(int op) {

int i;

double ll=0;

for (i=0; i<OrdersTotal(); i++) {

if (OrderType()!=op) continue;

if (OrderSymbol()!=sy) continue;

if (OrderMagicNumber()==Magic || OrderMagicNumber()==Magic+1) ll+=OrderLots();

}

return(ll);

here I need to return the summed volume by my symbol, and by type

Reason: