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

 
Maxim Kuznetsov:

Then draw a horizontal line.

Why do you need any buffers and their recalculation? ObjectSetDoubke(0,myHLine,OBJPROP_PRICE,concrete_price_value);

the user will see the line, you won't waste time recalculating the buffers, everyone is happy and happily disperse

PS/understand correctly - indicator buffer, it's for transferring(sharing/sharing) the results of calculations performed in the first place. Drawing a horizontal line of length N is different

the line should be a curve, i.e. its first value should show current Bid+size, the previous value - Bid+size tick back

And I will need this line to take indicator values for my EA
 

What is the correct syntax for a for statement when an expression consists of several parts?

I'm writing it like this:

for(int i=candle_two_index-1,int k=0;i>=candle_two_index-candles_oneside;i--,k++)
  {
  }

It doesn't compile.

 
Juer: What is the correct syntax in the for statement if the expression consists of several parts?

I write it like this: for(int i=candle_two_index-1,int k=0;i>=candle_two_index-candles_oneside;i--,k++)

Try to compile int i=candle_two_index-1,int k=0; or int i=1,int k=0; separately without loop - you will understand the error

 
Juer:

What is the correct syntax for a for statement when an expression consists of several parts?

I'm writing it like this:

It doesn't compile.

One int is redundant:

for(int i=candle_two_index-1,k=0;i>=candle_two_index-candles_oneside;i--,k++)
  {
  }
 

Good afternoon!

Do not pass by)

Could someone please help me in the following task: add alert to the indicator to trigger after the appearance of the signal on the screen, I would be thousandths of a thank you!

I really tried to do it myself, but it doesn't work.

 
Look elsewhere in another thread for a discussion of this
 

Good afternoon!

Question on mcl4 syntax: if I set a flag like this:

if(op1>cl2 && cl1>cl2) rost=true;
if(op1<cl2 && cl1<cl2) rost=false;

then the if(!rost) condition will catch only the condition for rost=false or all conditions not falling under rost=true?

Thanks.

 
novichok2018:

Good afternoon!

Question about mcl4 syntax: if I set a flag like this:

then theif(!rost) condition will catch only the condition for rost=false or all conditions not falling under rost=true?

Thanks.

The condition is unambiguous: if rost is false

 
Artyom Trishkin:

The condition is unambiguous: if rost is false

What happens to conditions that are neithertrue nor false? Will they be ignored, or for example the conditionif(op1>cl2 && cl1<cl2) is captured? According to Russian logic this is also "NOT". Unfortunately, the handbook does not explicitly state that (!a) = (a=false).

 
novichok2018:

What happens to conditions that are neithertrue nor false? Will they be ignored, or for example the conditionif(op1>cl2 && cl1<cl2) is captured? According to Russian logic this is also "NOT". Unfortunately, the handbook does not explicitly state that (!a) = (a=false).

If you specified rost without value it defaults to false
Reason: