Questions from Beginners MQL5 MT5 MetaTrader 5 - page 21

 

Does anyone spontaneously move the cursor in MetaEditor?

 
Renat:

Does anyone spontaneously move the cursor in MetaEditor?

No.

Hello Renat. If time permits from a specialist, if possible, take a look at the indicator ... For my question, see the description on the previous page. I can't cope with the code myself, it won't draw on Spot. I think I'm doing everything right but there's an error somewhere... I tried to sketch on Fours without any problems and everything is correct.

Thank you.

 
Not happening.
 
No, I haven't noticed that, but the symptoms are similar to an involuntary (or shorted) PageUp button
 
R0MAN:

Was immediately attached by me in my very first post of the previous page. I'd be grateful if you could take a look.


you don't understand the question.

The code compiles. no problems.

The problems appeared in runtime.


But I have a question - why don't you make an elegant solution via classes or structures?

You have 48(!) single-type lines and calculation calls in your code. It begs itself to make an array of classes for working with indices and handles. Even the most primitive solution, but it begs!

void OnDeinit(const int reason) 
  {
   IndicatorRelease(hMA_OPEN_S_EURUSD); IndicatorRelease(hMA_HIGH_S_EURUSD); IndicatorRelease(hMA_LOW_S_EURUSD); IndicatorRelease(hMA_CLOSE_S_EURUSD);
   IndicatorRelease(hMA_OPEN_F_EURUSD); IndicatorRelease(hMA_HIGH_F_EURUSD); IndicatorRelease(hMA_LOW_F_EURUSD); IndicatorRelease(hMA_CLOSE_F_EURUSD);
 
   IndicatorRelease(hMA_OPEN_S_GBPUSD); IndicatorRelease(hMA_HIGH_S_GBPUSD); IndicatorRelease(hMA_LOW_S_GBPUSD); IndicatorRelease(hMA_CLOSE_S_GBPUSD);
   IndicatorRelease(hMA_OPEN_F_GBPUSD); IndicatorRelease(hMA_HIGH_F_GBPUSD); IndicatorRelease(hMA_LOW_F_GBPUSD); IndicatorRelease(hMA_CLOSE_F_GBPUSD);
   
   IndicatorRelease(hMA_OPEN_S_EURGBP); IndicatorRelease(hMA_HIGH_S_EURGBP); IndicatorRelease(hMA_LOW_S_EURGBP); IndicatorRelease(hMA_CLOSE_S_EURGBP);
   IndicatorRelease(hMA_OPEN_F_EURGBP); IndicatorRelease(hMA_HIGH_F_EURGBP); IndicatorRelease(hMA_LOW_F_EURGBP); IndicatorRelease(hMA_CLOSE_F_EURGBP);
   
   IndicatorRelease(hMA_OPEN_S_EURJPY); IndicatorRelease(hMA_HIGH_S_EURJPY); IndicatorRelease(hMA_LOW_S_EURJPY); IndicatorRelease(hMA_CLOSE_S_EURJPY);
   IndicatorRelease(hMA_OPEN_F_EURJPY); IndicatorRelease(hMA_HIGH_F_EURJPY); IndicatorRelease(hMA_LOW_F_EURJPY); IndicatorRelease(hMA_CLOSE_F_EURJPY);
   
   IndicatorRelease(hMA_OPEN_S_USDJPY); IndicatorRelease(hMA_HIGH_S_USDJPY); IndicatorRelease(hMA_LOW_S_USDJPY); IndicatorRelease(hMA_CLOSE_S_USDJPY);
   IndicatorRelease(hMA_OPEN_F_USDJPY); IndicatorRelease(hMA_HIGH_F_USDJPY); IndicatorRelease(hMA_LOW_F_USDJPY); IndicatorRelease(hMA_CLOSE_F_USDJPY);
   
   IndicatorRelease(hMA_OPEN_S_GBPJPY); IndicatorRelease(hMA_HIGH_S_GBPJPY); IndicatorRelease(hMA_LOW_S_GBPJPY); IndicatorRelease(hMA_CLOSE_S_GBPJPY);
   IndicatorRelease(hMA_OPEN_F_GBPJPY); IndicatorRelease(hMA_HIGH_F_GBPJPY); IndicatorRelease(hMA_LOW_F_GBPJPY); IndicatorRelease(hMA_CLOSE_F_GBPJPY);   
   
  }

 
Renat:

Does anyone spontaneously move the cursor in MetaEditor?

No.

Only if you touch the touchpad with your hand. but it will be clear in all applications.

 
sergeev:

You don't understand the question.

The code compiles. there are no problems.

The problems appeared in the runtime.


But I have a question - why don't you make an elegant solution via classes or structures?

You have 48(!) single-type lines and calculation calls in your code. It begs itself to make an array of classes for working with indices and handles. Even the most primitive solution, but it begs!

I agree.

I'm learning MQL5. I'll do it when I'm ready.

I have no idea where the error lies. The formula for calculating the final line to display on the screen - the simplest.

When you have time, take a look at it, please.

Files:
 
You know, some of the variables are highlighted in colour, independent of me. I don't know what that means.
 
Here And what does the compiler say, please? It compiled on the chip! Is it related to this colour?
 

You know, I'm wildly sorry, I realized, you can't change value of variable with input modifier inside mql5-program, such variables are read-only.

Yes, but how to work with them in the usual way? Well, I'll think of something...

Reason: