Questions from Beginners MQL5 MT5 MetaTrader 5 - page 247

 
ierehon:

Hi all, I need help with the famous CrossArbitr indicator. The code is of course not mine. Needed some information, which it does not output. So, in order.

I added variablesdouble n, m;

"\nDifference BID Synthetic and Real =", n=(CalcBid-Bid),

"\, Difference ASK Synthetic and Real =", m=(CalcAsk-Ask),

"\nTotal =" (m - n) <----

It ends up swearing at the minus in this bracket (some operatot expected). Who can tell me what I'm doing wrong?

I need to add a comma:

   Comment("Реальный BID = ", DoubleToStr(Bid, Digits), ", реальный ASK = ", DoubleToStr(Ask, Digits), 
           "\nСинтетик BID = ", DoubleToStr(CalcBid, Digits), ", синтетик ASK = ", DoubleToStr(CalcAsk, Digits),
           "\nРазница BID Синтетика и Реального =", n=(CalcBid-Bid),
           "\, Разница ASK Синтетика и Реального =", m=(CalcAsk-Ask),
           "\nИтог =", (m - n)
           );
 

ToFleder

Thank you very much!

 
ierehon:

ToFleder

Thank you very much! Only for some reason the "Total" doesn't change... It's always zero.

To double-check, insert Print() before Comment
 

TObarabashkakvn

Thanks, I've already guessed it.

 
ierehon:

TObarabashkakvn

Thanks, I've already guessed it.

That's good. I recommend using the Print() operator in sporadic situations.
 
Hello all. I am new to this programming. I have started to learn MQL4 the other day. I downloaded Night Owl EA 3.02 for testing. My program has the ".ex4" extension. I installed it. It was idle for two days without doing anything. My Expert Advisor should trade only during night hours. I decided to open it in MQL4. I did not see the program. I have only a couple of lines. Прилагаю скрин. http://gyazo.com/98a44e962c4946ff2ed59e6919738b00
Screenshot by Gyazo
Screenshot by Gyazo
  • gyazo.com
Gyazo lets you instantly grab the screen and upload the image to the web.
 
serires:
Hello all. I am new to this programming. I have started to learn MQL4 the other day. I downloaded Night Owl EA 3.02 for testing. My program has the ".ex4" extension. I installed it. It was idle for two days without doing anything. My Expert Advisor should trade only during night hours. I decided to open it in MQL4. I did not see the program. I have only a couple of lines. Прилагаю скрин. http://gyazo.com/98a44e962c4946ff2ed59e6919738b00
Files with *.mq4 extension are opened in the editor.
 
R0MAN:
Files with *.mq4 extension are opened in the editor.
In my screenshot, the editor is open. I copied from the editor. What does this abracadabra look like there. You can see only a couple of lines there. Although the file itself weighs 43 Kb
 
serires:
In my screenshot, the editor is open. I copied from the editor. What does this gibberish look like there. You can see only a couple of lines there. Although the file itself weighs 43 Kb

Files with extensions: mq5, mq4, mqh can be edited.

Files with extensions: ex5, ex4 cannot be edited (as they are compiled files).

If you want to change the EA file - you need to find the editable EA code (not ex5, ex4).

 
papaklass:

Don't the control sequences ("\n") in the indicators work?

As you can see, the information is displayed on a single line. :(

int    ExtJawsHandle;
int    ExtTeethHandle;
int    ExtLipsHandle;
//--- bars minimum for calculation
int    ExtBarsMinimum;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
  Comment("У меня все работает", "\n", "Индикатор ", "\n", "\n", "Alligator");
//---- indicator buffers mapping
   SetIndexBuffer(0,ExtJaws,INDICATOR_DATA);
   SetIndexBuffer(1,ExtTeeth,INDICATOR_DATA);
   SetIndexBuffer(2,ExtLips,INDICATOR_DATA);
//--- set accuracy
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
//---- sets first bar from what index will be drawn
   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,InpJawsPeriod-1);
   PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,InpTeethPeriod-1);
   PlotIndexSetInteger(2,PLOT_DRAW_BEGIN,InpLipsPeriod-1);
//---- line shifts when drawing
   PlotIndexSetInteger(0,PLOT_SHIFT,InpJawsShift);



Reason: