Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 505

 
ArturR:

Hi all!

I spent half the night trying to figure out why a simple condition does not work, please help me figure it out:

I am running on historical data, the variables macd1,2, lowprice, highprice are assigned values, but the condition does not want to run, I broke my head can not understand where to dig ... (((

      macd1 
      macd2 
      highprice1 
      highprice2
      lowprice1
      lowprice2

the variables are all double ?

 

I'll repeat the question - can you please tell me if it's unchecked without the dll?


 
Nikolay Gaylis:

I'll repeat the question - can you please tell me if it's unchecked without the dll?


No

 
Alexey Viktorov:
OnChartEvent() doesn't work in the tester.

Thank you.

 
Nikolay Gaylis:

All variables are all double ?

Yes all double, it compiles without errors.

 
ArturR:

Hi all!

I spent half the night trying to figure out why a simple condition does not work, please help me figure it out:

I am running on historical data, the variables macd1,2, lowprice, highprice are assigned values, but the condition does not want to run, I broke my head can not understand where to dig ... (((

First of all, note that you're using zero bar data. This data is not constant (one tick has one data, the next tick has another data).

Secondly, how did you check that the condition is not fulfilled?

 
ArturR:

Hi all!

I spent half the night trying to figure out why a simple condition does not work, please help me figure it out:

I am running on historical data, the variables macd1,2, lowprice, highprice are assigned values, but the condition does not want to run, I broke my head can not understand where to dig ... (((

iHigh, iLow should be used instead of High, Low

 
Ihor Herasko:

Firstly, note that you are using zero bar data. This data is not constant (one tick is one, the next tick is another).

Secondly, how did you check that the condition is not met?

1. Yes, there is a case for zero bar in the code, no way to check which case I tested now, I will check tonight.

2. I checked it by outputting a comment to a chart with values of values, macd, High and Low have values and min(max)price does not get the corresponding values.

 
Taras Slobodyanik:

I need to use iHigh, iLow instead of High, Low

Thanks, I will check it in the evening, but I don't understand why Highprice receives a value, but min and max price are still zero?

 
Artyom Trishkin:

A complete mess and a misunderstanding of what you are doing...

//--- И далее вообще не понятно к чему у вас фигурные скобки - они висят в пустоте, а это составной оператор, который должен после условия идти.
после каждого if стоит всегда открывать фигурную скобку?или чем чревато мое расположение фигурных скобок?