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

 
Slava2007:

But how to insert it into MQL4. It is not included in the standard set of built-in indicators, is it?

https://docs.mql4.com/ru/indicators/iCustom
 
sergeev:

so you're on the minutes.

1000 first bars (17 hours converted) is not enough to refer to the previous day.



Where does the figure of 1,000 bars come from? I don't get it.
 
Zzumer:

Where did the figure of 1,000 bars come from? I don't get it.

How many bars do you have in the tester when you start?
 
sergeev:

and how many bars do you have in the tester when you start?


That is, the tester contains an incomplete history when it starts?

Now, by the way, the Expert Advisor is working correctly.

 

Hello!

When placing SELL STOP pending orders, I keep getting error 130 - invalid stops. But a BUY STOP order with the same parameters is placed without any problems. Here is a fragment of code

 double stoploss=0;
  double takeprofit=0;
  open_positions(OP_SELLSTOP, sellLot, buyPrice, stoploss, takeprofit, Symbol());
  open_positions(OP_BUYSTOP, buyLot, buyPrice, stoploss, takeprofit, Symbol());

This is a call of a user-defined function, and below is the body of the user-defined function. What is interesting, even if 0 is explicitly put in the OrderSend call instead of a variable, the error is still shown! What may be the problem?

while(i<=Count_Of_Trade_Try) {
    
    int ticket = OrderSend(symb,      
                           type,        
                           lot,           
                           price,        
                           Slipage,      
                           stoploss, 
                           takeprofit, 
                           Order_Comment, 
                           Magic_Number,  
                           0,             
                           CLR_NONE);     
    if(ticket!=-1) 
      break;
    err=GetLastError(); 
    Print("error=",err);
 
ArgentumZ:

Hello!

When placing SELL STOP pending orders, I keep getting error 130 - invalid stops. But a BUY STOP order with the same parameters is placed without any problems. Here is a fragment of code

This is a call of a user-defined function, and below is the body of the user-defined function. What is interesting, even if 0 is explicitly put in the OrderSend call instead of a variable, the error is still shown! What may be the problem?

Find the error yourself by reading the Tutorial, and in this case specifically the Characteristics of Orders and Rules of Trading.
 
Changed the order to Sell (naturally changing the order price to the current price, but not touching the stoploss) - opens normally. Trying Sell Limit - same song - wrong stops!
 
MaxZ:
Find the error yourself by reading the Tutorial, and in this case specifically the Characteristics of Orders and Rules of Trading.
I did, I know about the freezing distances, etc., but I don't understand how a zero stop loss relates to all of these limitations! If you see a mistake - tell me. I read the manuals carefully before writing here. I wouldn't write them if I didn't have to.
 
forexnew:

How can I set it to download only some timeframes (not all of them): minutes, 1 hour and days?

Thus: string sTimeFrame = {"M1", "H1", "D1"}; // The string that lists the scanned TF.

On minutes it downloads no more than 2000 bars and my EA needs more than 7000. After pumping with this script, my EA will pump more.

Is it designed this way, not all bars are downloaded?

I download everything the server gives me. That's about 60,000 bars. The server doesn't store any more.
Reason: