[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 201

 

Can someone advise how to find the current (highlighted) chart window symbol out of the open ones, not the one with the attached script/advisor, but the one that is currently active in the terminal (as they also say in the focus)

 
harbor:

Can someone advise how to find the current (highlighted) chart window symbol out of the open ones, not the one with the attached script/advisor, but the one that is currently active in the terminal (as they also say in the focus)

Get the window descriptor at the top of Z-sequence of chart windows. Then get the header based on it, and parse it.
 
Zhunko:
Get the window descriptor at the top of Z-sequence of chart windows. Then get header by it and parse it.


Well, mql4 seems to have only one function withWindowHandle

But I'm making a dll, is it possible to do this through winapi somehow? There's a function calledGetWindowText by handle

How do I get the handle?

 
harbor:


Well, mql4 seems to have only one function withWindowHandle

But I'm making a dll, is it possible to do this through winapi somehow? There's a function calledGetWindowText by handle

How do I get the handle?

Well, in DLL you need to get the handle of the window at the top of Z-sequence. There is an MDI client. It is the parent of the graph windows. That's where to get that descriptor.
[Deleted]  
Please advise what will happen if you trade EURJPY and USDJPY with equal lots (if not equal). Maybe someone has experienced it (I need a variant of calculation)
 
YOUNGA:
Please advise what will happen if you trade EURJPY and USDJPY with equal lots (if not equal). Maybe someone has experienced it (I need a variant of calculation)
Calculation of what?
 
YOUNGA:
Please advise what will happen if you trade EURJPY and USDJPY with equal lots in different directions (or if not). Maybe someone has tried it (I need a variant of calculation)

Here EUR and USD are the base currency, and lot is calculated in it. I.e. for the first pair 1 lot is 100.000 EUR, for the second it is 100.000 USD, in both cases bought/sold for Yen.
[Deleted]  


Let me explain if you open one lot on each EURJPY and USDJPY pair then EURUSD lot should be 1 point change in the price of EURUSD something must happen with the synthetic EURJPY/USDJPY since they are correlated



 

Trying to code the following idea.

If the time is 01.00.00. or 03.00.00.

Open an order upwards.

At other times, open a down order.

PROBLEM The program compiles at 01:00:00 and opens a buy order but does not read || or anything after it.

if(Hour( )==01 && Minute( )==00 && Seconds()==00||Hour( )==03 && Minute( )==00 && Seconds()==00 )

I. e. at03.00.00 the tester opens not a buy position, but a sell position.

All other deals are opened in accordance with the code.

  if(Hour( )==01 && Minute( )==00 && Seconds()==00||Hour( )==03 && Minute( )==00 && Seconds()==00 )
 
    
   {  
      if (Bid==Price  )
     
  int Ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,SL,TP );
  }
  else
  {
  SL=NormalizeDouble (Price+3000*Point, Digits);         
  TP=NormalizeDouble (Price-100*Point, Digits);
  Ticket=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,SL,TP );
 }
 }
 }

Делал два заголовка if ...... вообще не открывает сделки

 if(Hour( )==01 && Minute( )==00 && Seconds()==00 )
  if(Hour( )==03 && Minute( )==00 && Seconds()==00)
    
   {  
      if (Bid==Price  )
     
  int Ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,SL,TP );
  }
  else
  {
  SL=NormalizeDouble (Price+3000*Point, Digits);         
  TP=NormalizeDouble (Price-100*Point, Digits);
  Ticket=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,SL,TP );
 }
 }
 }
Подскажите - как сделать так что бы в 03.00.00. открывалась сделка на покупку? Спасибо
 
solnce600:

PROBLEM The program compiles, at 01.00.00 it opens a buy trade, but does not read || and the character after it.

if(Hour( )==01 && Minute( )==00 && Seconds()==00||Hour( )==03 && Minute( )==00 && Seconds()==00 )

I. e. at03.00.00 the tester opens not a buy position, but a sell position.

All other deals are opened in accordance with the code.


Well for starters get used to putting brackets where you need them. Like that:

if((Hour( )==01 && Minute( )==00 && Seconds()==00) || (Hour( )==03 && Minute( )==00 && Seconds()==00))
In fact, you should have a time range, not a fixed value. Your logic is not correct at all. Not 1 hour OR 3 hours, but from 1 hour to 3 hours!