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

 
Fox_RM:

Yes, that's exactly the problem, I don't know how to do a day or hour sweep. PERIOD_D1 will select a new day, but how to extract the time?

I also tried a specific time assignment to do D'00:00:00', in the handbook says that you can, but somehow it did not work?


I have shown how to select the opening time of the day
 

I have a problem.

I want to draw some lines in the EA during testing, particularly in the indicator Accumulation/Distribution

In the program module this indicator is called

...

double myAD = iAD(Symbol(), 0, 1);

...

The problem itself is

...

int iWin_IDx = WindowFind("A/D");

...

- does not find the window of the indicator, in this case iWin_IDx=-1;

Tried inserting code into init() function result is the same

The WindowsTotal() function returns 1, thus showing that there is only one window, the currency quote window.

I think the problem is that the indicator window appears after EA execution - how to make it appear before test execution.

 
LuckyStrike:

Doesn't seem to want to, gives error 138( Trying to trailing)


138 - New prices(requotes)

In your code

int start()
 {
    if (OrdersTotal()==0 && Open>Bid)
      OrderSend (Symbol(),OP_SELL,Lots,Ask,3,Bid+150*Point,Bid-150*Point,0,Red);//Если пятизначные котировки, тройку измените на 30 
      
         if(OrderSelect(OrdersTotal()-1, SELECT_BY_POS, MODE_TRADES))
           if (Bid-(Bid+150*Point)<-150)//От бид отнимаем бид? Упрощаем выражение и от бида вообще ничего не осталось, т.е. так if(150*Point<-150) ?
          {
            OrderModify(OrderTicket(),OrderOpenPrice(),Bid+150*Point,Bid-150*Point,0,Red);
          }
 }
 
Thank you, I really should have put 30 there. But OrderModify doesn't work for some reason, and the stop loss should move after the price.
 
LuckyStrike:
Thank you, I really should have put 30 there. But OrderModify doesn't work for some reason, stop-loss should move after the price.


Because the condition if (150*Point<-150) is not fulfilled.

 
There we take a stop loss from bid, and if the difference is less than -150, then OrderModify should move the spol-loss to follow the price, but it doesn't happen)
 
LuckyStrike:
Well, it does, but it doesn't work)


Do you have a Point negative value, less than -1? In any other case, the condition is not feasible.

And even in the first case, the condition fails - Point is a predefined variable and you can't assign its value (including a negative one).

--------

Conclusion: your condition is impossible to fulfill :)

 

Hello, I have MT4 of one brokerage company and MT4 of another one. i transferred servers (.srv) in the folder \Program Files\MetaTrader 4\config no problem, but with MT4 and MT4Multiterminal (different brokerage companies too) does not work......

I changed my IP in .srv/I tried many DTs/I tried renaming/It DOES NOT work................ACK. INACTIVE AND NO GRAPH

how to do it??????

 
Vinin:

I showed you how to choose the opening time of the day
Got it! Thank you. Question cleared.
 
Snik75I:

I have a problem.

I want to draw some lines in the EA during testing, particularly in the indicator Accumulation/Distribution

In the program module this indicator is called

...

double myAD = iAD(Symbol(), 0, 1);

...

The problem itself is

...

int iWin_IDx = WindowFind("A/D");

...

- does not find the window of the indicator, in this case iWin_IDx=-1;

Tried inserting code into init() function, the result is the same

The WindowsTotal() function returns 1, thus showing that there is only one window, the currency quote window.

I think the problem is that the indicator window appears after EA execution - how to make it appear before test execution.

And you put an indicator on the test chart before you start testing