[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 527

 
 
0x is exactly the 16-digit number.
 
Good morning! Condition doesn't work
bool CCInapravlenie=false;
if( CCI_50S>100&&CCI_50<100 ||CCI_50S>0&&CCI_50<0|| CCI_50S>-100&&CCI_50<-100 )CCInapravlenie=true;

if(CCInapravlenie){ imja = DoubleToStr(Time[0], 0); 
ObjectCreate(imja, 22, 0, iTime(NULL,0,0),iLow(NULL,0,0)-0.0001);ObjectSet(imja, OBJPROP_ARROWCODE, 241);
ObjectSet(imja, OBJPROP_COLOR , Yellow); // стрелка жолтая 
}//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

I've already looked at the ife string, looked at it, looked at it, looked at it.... There must be some reason, I may be confused and not see something simple and elementary, it happens.

I looked in the morning. I went out. I came back and looked again. It's easier now, ifs, more, less... I don't get it at all.



And this is under my start.
double EMA_10 = iMA( NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
double EMA_20 = iMA( NULL , 0, 20, 0, MODE_EMA, PRICE_CLOSE, 0);
double LMA_100 =iMA( NULL , 0, 100, 0, MODE_LWMA, PRICE_CLOSE, 0);
double МА_30 = iMA( NULL , 0, 30, 0, MODE_SMA, PRICE_CLOSE, 0);
double CCI_50 = iCCI( NULL, 0, 50, PRICE_CLOSE, 0);

double EMA_10S = iMA( NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, 1);
double EMA_20S = iMA( NULL , 0, 20, 0, MODE_EMA, PRICE_CLOSE, 1);
double LMA_100S =iMA( NULL , 0, 100, 0, MODE_LWMA, PRICE_CLOSE, 1);
double МА_30S = iMA( NULL , 0, 30, 0, MODE_SMA, PRICE_CLOSE, 1);
double CCI_50S = iCCI( NULL, 0, 50, PRICE_CLOSE, 1);


p.s. It's all part of this strategy condition

EMA - period 10 crosses from top to bottom EMA - period 200 , CCI crosses 0.100 or 100 from top to bottom; Candle closes or is below LMA - period 100
 
TheXpert:
0x is exactly the 16-digit number.

Thank you.
 

No yellow arrows at all. The devil knows. And even though the zirk condition works!!!!

Zirk condition.

bool napravlenieCCI=false;
 if( CCI_50S<100&&CCI_50>100 ||CCI_50S<0&&CCI_50>0|| CCI_50S<-100&&CCI_50>-100  )napravlenieCCI=true;
  if(napravlenieCCI){  string imja = DoubleToStr(Time[0], 0);
  ObjectCreate(imja, 22, 0, iTime(NULL,0,0),iHigh(NULL,0,0)+0.0004); 
  ObjectSet(imja, OBJPROP_ARROWCODE, 242);
  Print(" ObjectSet242  ", GetLastError());
  ObjectSet(imja, OBJPROP_COLOR , Red);Print(" сOBJPROP_COLO  ", GetLastError());}

Screenshot

 
TarasBY:

You do not fill the 0th index of the indicator arrays,

you refer to it:

It's a bit (structurally) crooked, but it'll do for the first time. My advice: "Get used to correct approaches to writing code right away. For example, use this condition in your code:

It is illiterate, because sooner or later, you will leave the tester to on-line trading and several EAs may be running in parallel, and this code will not work.


Thank you for your reply!

I'll know. You should study arrays more.

I wrote the "Total==0" condition just to quickly check my idea in practice. I will now look through the Code Base and try to find something similar to fix this condition.

I absolutely agree with you. You must learn to write code correctly. I will correct myself.

Thank you very much for your help.



 
Vinin:

What don't you like about iHighest() and iLowest()?


I didn't know about these functions. I'll give them a try now.

Thanks for the information!

 
TheXpert:
0x is exactly the 16-digit number.

Hexadecimal refers to both. e.g. 0x0000 in C, 0000H in assemblers.
 

Hello.

Can you please tell me how I can add the information I receive to the file? I.e. I get a number, it needs to be written into the file - at the end of the file without deleting all of its contents.

It seems to FileWriteString but for some reason is written to emptiness instead of what is there... can someone give me an example how to do it right?

... Also, the recording is done, if it is done, in an incomprehensible encoding that is unreadable -((

Thanks.

 
TarasBY:

You do not fill the 0th index of the indicator arrays,

you refer to it:

It's a bit (structurally) crooked, but it'll do for the first time. My advice: "Get used to correct approaches to writing code right away. For instance, use this condition in your code:

Because sooner or later, you will leave the Strategy Tester and switch to on-line trading, where several EAs are running in parallel and this code will not work.


As far as I understand, I need to re-do it this way:

double L_1= iCustom(NULL,0,"Go_go",K,0,1);  //Линия минимума
double L_2= iCustom(NULL,0,"Go_go",K,1,1);  //Линия максимума 

Same problem again. When I launch the Expert Advisor, it opens an SELL order right away.

Can you please explain why?