[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 179

 
Dimka-novitsek:
Good day! If I write Buffer1[0]=Close[i] inside of a chart which is located on a certain pair, say Eurodollar, I get the price of this pair. But if I want to share with Close[i] another pair, say, GBPUSD?
iClose("GBPUSD", Period(), i);
 
Geez, THANK YOU!!!
 
ilunga:

1) How you set up the Cls_ array

2) but why is it needed in this task in principle? Just save 1/2/3 in Cls_ and write:


1) Can't set can't describe array correctly - gives error. Especially just can't - as [i] is related to magicians and closing orders... It's just - it gets cumbersome... I want it to look nice.

In words: Opn [i] - we open an order with MagNum [i+10]

if there is an order with MagNum [i+10] - then Cl [i]

Cl [i] - close Lot/(4-i) from i=1 to i=3

 
Roman.:


Who could have doubted it... It should have been clear as day in my opinion. :-)))

I helped you in your research to come to THIS decision.

I wonder what was supposed to be "clear as day" on the basis of? Roman, thanks for your help - but it turned out to be a Sisyphean task - a waste of time, and not a small one at that. If you knew for sure that it was not working, I think you could have said at once, without holding back: I would have spent this time on researching other options. As it is, a couple of months is wasted.
 

100yan:

In words: Opn [i] - open an order with MagNum [i+10].

if there is an order with MagNum [i+10] - then Cl [i]

Cl [i] - close Lot/(4-i) from i=1 to i=3

do not understand anything)

if there is an order with MagNum [i+10] - then Cl [i].

Cl [i] what? after "that" there should be a description of what should be executed (i.e., body of if statement), and Cl [i] is just a variable. it should be an operation with a variable/

you're told to write in words what you want. i.e. the gist of actions in russian. what's being done and why.

 
100yan:



Cl [i] - close Lot/(4-i) from i=1 to i=3

// создаем массив Cl из 4 элементов (с 0 по 3)
bool Cl[4];
for (int i = 1; i<=3; i++)
   Cl[i] = false;

..бла-бла-бла..
// возникло условие, что 2 ордер надо закрыть
Сl[2] = true;
..бла-бла-бла..

// проверка условий закрытия ордеров
for (int i = 1; i<=3; i++)
  if (Cl[i])
  {
     LotCt=NormalizeLot(OrderLots()/(4-i));
     Cl[i] = false;
  }
Is this the kind of thing you want?
 
How do I turn off a MetaTrader that has glitched?
 
volshebnik:
I wonder on what basis it should have been "clear as day"? Roman, thanks for your help - but it turned out to be a Sisyphean task - a waste of time, and not a small one at that. If you knew for sure that it was not working, I think you could have said at once, without holding back: I would have spent this time on researching other options. But now you've wasted a couple of months.

...And experience is the son of mistakes...
 
Dimka-novitsek:
How do I turn off a MetaTrader that has glitched?

Kill it from the processes... what's easier
 
ilunga:
Is this the kind of thing you want?



Thanks for the example! I'll try to implement...