[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 811

 
obla4ko:

Dear "fellow travellers" and captains! Question: how to make two different indicators to be shown in one separate window in the PROGRAM, not by drag and drop(!) - as on my

picture - here I first opened ROC and then dragged from the navigator" Bolinger". When I write indicator_separate_window in Bollinger - it opens in a separate window, but a different one!?

HOW DO I PRESCRIBE THE RIGHT "WINDOW"? :))

I don't know if it helps... But I use A/D indicator window search for my purposes like this:

WinID=WindowFind("A/D");               // Номер окна AD

Maybe if I prescribe the window number returned by this function as the number of the window to display the next indicator in, it will work?

Honestly - I haven't tried it; so... you've got an idea, you've got to try it... :)

 
artmedia70:

I don't know if this helps... But I use the A/D indicator window search for my purposes like this:

Maybe if I prescribe the window number that this function returned as the number of the window to display the next indicator in, it will work?

Honestly - have not tried, so ... I have an idea - you try it... :)


THANKS FOR YOUR PROMPT AND "SPICY" ANSWER! :))

I'll write-try and tell you how it worked!

 
obla4ko:

THANK YOU FOR YOUR PROMPT AND "SPARKLING" RESPONSE! :))

I'll write it down, I'll try it out, I'll tell you how it turned out!

You're welcome for now... :)
 
Techno:
show how you use the ilow function
iLow(NULL, PERIOD_D1, 1);
as if the EA got a value and works itself - let's say the results differ from the number of ticks, but then on which TimeFrame to optimise and on which to use?
 

Hi all. Such a question:

total = OrdersTotal();
THVOpenedPos  = 0;
StohOpenedPos = 0;
THVOpenedPos = OrdersCountTHV ();
StohOpenedPos = OrdersCountStoh ();
Comment (total); // здесь всегда 0, даже если есть открытые позиции!
int OrdersCountTHV()
{
total = OrdersTotal();
if (total >0)
   {
      for (int i = 0; i < total; i++)
      {
         if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)==true) 
         {
            if (OrderMagicNumber() == THVMagic)
               if (OrderSymbol()   == Symbol())  
                  {
                  THVOpenedPos++;
                     
                  }
         }
      }
   }
return (THVOpenedPos);
}

OrdersCountStoh (); is similar.

Why total is always 0?

 
MarkTrade:

Why is total always 0?


normally the order count is done like this

int Myorders(){
      int cnt;
      total_order = OrdersTotal();
      int my_total_order = 0;
      for(cnt = total_order - 1; cnt >= 0; cnt--) {
         OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic)  my_total_order++;
      }
return(my_total_order);
}
 
IgorM:


Then you don't have any open orders, normally the order count is done like this:

that's the thing... I am running a visualization in the tester and after I open a position the comment does not change :(

but order counting gives the right results ...

 
MarkTrade:

That's the thing... In the tester, in visualization mode, and after opening a position, the comment does not change :(

And the order count is correct ...


your total = OrdersTotal(); probably, it has been declared in global variables (at the very top) and maybe you changed it somewhere, try to add

Comment (total," / ",OrdersTotal()); // здесь всегда 0, даже если есть открытые позиции! 
 

same thing...

 
artmedia70:
Well, there is nothing for it yet... :)

WOW! I was rejoicing too early... this function does not take it - it does not see it, although it is actively dragged with the mouse, probably JavaScript is needed... I wonder if it's possible to "embed" JavaScript in MQL?

Or a separate indicator may be written as "ROC+BAND" in one package... By any chance, don't you know how to compare ROC and MA or Bollinger values - in what units? Let's say you need to prescribe "if ROC crosses МА from the bottom up - buy... "Is there any indexes of conversion of readings of one indicator to another?

Reason: