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

 
libeadier:

Print(digits) outputs 5

I simply get the price via print(hign[1])


I told you - read the documentation. Let me explain: why don't you read the Help file for the function?

void Print( ...) 
Печатает некоторое сообщение в журнал экспертов. Параметры могут иметь любой тип. 
Количество параметров не может превышать 64.

Массивы нельзя передать в функцию Print(). Массивы должны быть напечатаны поэлементно.

Данные типа double выводятся с 4 десятичными цифрами после точки. Чтобы получить большую точность, 
следует использовать функцию DoubleToStr().
Данные типов bool, datetime и color будут напечатаны в виде чисел.
Чтобы печатать значения datetime как строку с датой, следует использовать функцию TimeToStr().
См. также функции Alert() и Comment(). 

Or are you going to bang on an open door?

 
Xaoss1990:

Please help a newcomer!

How to display indicator lines on a chart in an Expert Advisor?

I do it in the indicator - it works, I copy the code to the Expert Advisor - it does not work (((


https://book.mql4.com/ru/samples/shared
 
Good afternoon, could you please tell me why the tester is not working right now at 11:33 Moscow time? Is it because there is no trading today? The currency data is available.
 
first_may:
Good afternoon, could you please tell me why the tester is not working right now at 11:33 Moscow time? Is it because there is no trading today? The currency data is there.

Look at the log. My tester is working at the moment.
 
Roll:

Look at the log. My tester works at the moment.


Thank you, it worked. The mistake was a close stop loss. I wrote it like this:

VStopLossLong=Ask+MarketInfo(Symbol(),MODE_STOPLEVEL); // Minimal allowed stop loss level for BUY
VStopLossShort=Bid-MarketInfo(Symbol(),MODE_STOPLEVEL); // Minimal allowed stop loss level for SELL

Can you tell me where there is an error?

 
first_may:


Thank you, it worked. The mistake was a close stop loss. I wrote it like this:

VStopLossLong=Ask+MarketInfo(Symbol(),MODE_STOPLEVEL); // Minimal allowed stop loss level for BUY
VStopLossShort=Bid-MarketInfo(Symbol(),MODE_STOPLEVEL); // Minimum allowed stop loss level for SELL

Can you tell me where the mistake is?


For sell stops from Ask, for buy stops from Bid - in your case it is vice versa... :-)) Therefore the distance is still less than the minimum... Example:

 {                                   //.. не достигнут успех
      if (StopLoss<Level_new)            // Если меньше допустимого..
         StopLoss=Level_new;             // .. то допустимый
      if (TakeProfit<Level_new)          // Если меньше допустимого..
         TakeProfit=Level_new;           // ..то допустимый
      MN=TimeCurrent();                  // Простой MagicNumber
      Inform(13,Tip);                    // Сообщение о попытке откр
      if (Tip==0)                        // Будем открывать Buy
        {
         SL=Bid - StopLoss*  Point;      // StopLoss   (цена)
         TP=Bid + TakeProfit*Point;      // TakeProfit (цена)
         Ticket=OrderSend(Symbol(),0,Lots_New,Ask,2,SL,TP,"",MN);
        }
      if (Tip==1)                        // Будем открывать Sell
        {
         SL=Ask + StopLoss*  Point;      // StopLoss   (цена)
         TP=Ask - TakeProfit*Point;      // TakeProfit (цена)
         Ticket=OrderSend(Symbol(),1,Lots_New,Bid,2,SL,TP,"",MN);
        }
Full description - see here, all necessary checks before setting and modifying orders - here.
 
first_may:


Thank you, it worked. The mistake was a close stop loss. I wrote it like this:

VStopLossLong=Ask+MarketInfo(Symbol(),MODE_STOPLEVEL); // Minimal allowed stop loss level for BUY
VStopLossShort=Bid-MarketInfo(Symbol(),MODE_STOPLEVEL); // Minimal allowed stop loss level for SELL

Can you tell us where there is an error?

Forget for a moment that, on the contrary, StopLoss should be set lower for Buy, and higher for Sell...


Let's select the currency pair EURUSD. We need to open a short position. I select the first available terminal:

- quotes are 4 digits;

- Lastly fixed Bid = 1.4396 (of course, the issue is not the point);

- MarketInfo(Symbol(),MODE_STOPLEVEL) returns value 2.

Let's calculate the value of the variable VStopLossShort:

VStopLossShort = 1.4396-2 = -0.5604

O_O

Although, if a pair is selected, for example, USDJPY, if you accidentally swap SL and TP, there shouldn't be an error... :)))))))))))))))))

 

Hello Gianni...

 

Guys, help if you have the time and some desire... I understand it's the weekend, but it just so happens...

 
GALO4KA1971:

Hello, Gianni...

Can I take it to you in private?


GALO4KA1971:

Guys, help if you have time and some desire... I know it's the weekend, but it just so happens...

Can I do it all at once?

Some people don't rest on their days off either...

Reason: