[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 493

 
FOReignEXchange:
Well, then you'd better post the code together with W. If it's not working, it must be wrong.

this is the price zz "y" it changes in the comments it is calculated normally, is an integer int

if(MathAbs(10 + 100*shift - y) <= 10)

it changes in the comments...

for(int shift=0; shift<19; shift++){
    if(MathAbs(10 + 100*shift - y) <= 10) Comment("ура нашел",y); else Comment("кури бамбук",y);} 

But it categorically doesn't want to change the comment to the opposite one, I insert another condition in if works as it should, what's wrong with this if()?

if(MathAbs(10 + 100*shift - y) <= 10)
 
In short, it all makes sense.
 
I did it the other way around. The issue is resolved, thank you all.
 
good afternoon, advise what is wrong here, trying to write the order type definition to the closing criteria

if (Tip==0 && Opn_B==true)
{
if(bb<0 && bb1<0 || bb<0 && MA1 < MA2 || bb1<0 && MA1 < MA2)
{
Cls_B=true;
}
}

 
vilard:
good afternoon, advise what is wrong here, trying to write the order type definition to the closing criteria

if (Tip==0 && Opn_B==true)
{
if(bb<0 && bb1<0 || bb<0 && MA1 < MA2 || bb1<0 && MA1 < MA2)
{
Cls_B=true;
}
}


Who knows your logic? But you need to know that OR has priority.
 
how do I write to include the "and" first?
 

Can you tell me why the array is not filling with values? It outputs zero.

extern int n=15; // No. of bars
int Total; // No. of calls to the start function

int start()
{
if (Total>=1) return; // we need 1 time here
Total++;

double mas[];
for (int i=1; i<=n; i++)
{
mas[n]=iOsMA(NULL,0,9,21,5,PRICE_CLOSE,i);
Print ("OsMA = ",iOsMA(NULL,0,9,21,5,PRICE_CLOSE,i));
}
Print ("Array = ",mas[2]);
Print ("Array = ",mas[10]);

return;
}

 

Good evening !

int iBars( string symbol, int timeframe) . If I use symbol=NULL everywhere in the program, how do I know what symbol equals ?

 
 
vilard:
how do I write to include the "and" first?
You have to put parentheses in round brackets.
Reason: