Forum

"Break" and "decimal point" problems

int size= ArraySize (close); double sum[]; ArrayResize (sum,size,size); ArrayInitialize (sum, EMPTY_VALUE ); for ( int i = 0 ; i<size ; i++) { sum[i]=close[i]+close[i+ 1 ]; ArrayPrint (sum, Digits ()+ 1 ); } purpose: Add two

Oncalculate function question!

int OnCalculate ( const int rates_total, const int prev_calculated, const datetime &time [], const double &open [], const double &high [], const double &low [], const double &close [],

Double array size?

double HighBroadreachArray[]; int HighBroadreachArr= sizeof (HighBroadreachArray)/ sizeof ( double ); void OnStart () { CopyClose ( Symbol (), PERIOD_M5 , 0 ,HighBroadreachArr,HighBroadreachArray); Print (HighBroadreachArr); Print ( "HighBroadreachArray:" , sizeof (HighBroadreachArray));

It seems to be a problem in the instructions

void OnStart () { uchar u_ch; for ( char ch=- 128 ;ch<= 127 ;ch++) { u_ch=ch; Print ( "ch = " ,ch, " u_ch = " ,u_ch); if (ch== 127 ) break ; } } When executing the program, the first time u_ch=ch, ch=-128,u_ch=0. However, when printing, ch= -128 u_ch= 128

Can't get value!

Why doesn't that get me to value? Also, no errors in the compiler, but errors in MT5... void OnStart () { double Close0[]; double Low0[]; CopyClose ( Symbol (), PERIOD_CURRENT , 0 , 1 ,Close0); ArraySetAsSeries (Close0, true ); CopyLow ( Symbol (), PERIOD_CURRENT , 0 , 1 ,Low0);

They're all int. Why do I have to convert?

double b1[]; double b2[]; double b3[]; double b4[]; double b5[]; void OnStart () { int a1= CopyOpen ( Symbol (), PERIOD_M5 , 0 , 1 ,b1); int a2= CopyOpen ( Symbol (), PERIOD_M5 , 0 , 2 ,b2); int a3= CopyOpen ( Symbol (), PERIOD_M5 , 0 , 3 ,b3); int a4= CopyOpen ( Symbol (), PERIOD_M5 , 0 , 4 ,b4);

In MT5, where is the price data stored?

In MT5, where is the price data stored

Is there a difference between "if" and "&&"?

double MathematicalAchievement = 90 ; double ScoreOfChinese = 80 ; void OnStart () { if (MathematicalAchievement> 90 && ScoreOfChinese> 90 ) { Print ( “VeryGood” ); } } double MathematicalAchievement = 90 ; double ScoreOfChinese = 80 ; void OnStart () { if

How to properly understand "indicator_buffers"?

“indicator_buffers int Number of buffers for indicator calculation" How should understand correctly?For example, MACD indicators , we only see "MACD" and "Signal" in MT5, but why are "#property indicator_buffers 4" written in MQL5? #property indicator_buffers 4 thank you