[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 335

 
Ctmcn:


There is no such function in the source code of the "simple EA". Where to write it, in that case, in my variant - my knowledge is not enough:

P.S. There is only in the order opening block (8).

You have an error here, you get the same thing 4 times.

   double b4plusdi=iCustom(NULL,0,"ADX Crossing",A,B);
   double nowplusdi=iCustom(NULL,0,"ADX Crossing",A,B);
   double b4minusdi=iCustom(NULL,0,"ADX Crossing",A,B);
   double nowminusdi=iCustom(NULL,0,"ADX Crossing",A,B);
 

Please advise, there is a function for drawing a label:

void RightText(int tWindow, string tName, string tText, int tCorner, int tX, int tY, int tFontsize, color tColor)
{
ObjectCreate ("tName",OBJ_LABEL, 0,0,0);              // Создание объекта
ObjectSetText("tName",tText);
ObjectSet    ("tName",OBJPROP_CORNER, tCorner);       // Привязка к углу
ObjectSet    ("tName",OBJPROP_XDISTANCE, tX);         // Отступ по горизонтали 
ObjectSet    ("tName",OBJPROP_YDISTANCE, tY);         // Отступ по вертикали
ObjectSet    ("tName",OBJPROP_COLOR,tColor);          // Цвет обьекта
ObjectSet    ("tName",OBJPROP_BACK, true);            // Background 
ObjectSet    ("tName",OBJPROP_FONTSIZE, tFontsize);   // Fontsize
}         

When the function is called twice in a row (I want to draw two labels in different places), only the last one remains:

RightText(0,"righttest1","надпись1", 1, 50, 25, 24, Red); 
RightText(0,"righttest2","надпись2, 2, 50, 25, 24, Red); 

 
Pyro:

Please advise, there is a function for drawing a label:

When the function is called twice in a row (I want to draw two labels in different places), only the last one remains:

ObjectCreate ("tName",OBJ_LABEL, 0,0,0);              // Создание объекта

You create an object with the name "tName", and you want the name passed in the variable tName

 
The function receives the value (name) of the variable tName when it is called. In this case, tName takes the names of
righttest1
righttest2
 
Pyro:
The function receives the value (name) of the variable tName when it is called. In this case, tName takes the names of
n agree that variable names are not taken in quotes " tName":))))
 
sergeev:
n agree that variable names are not taken in quotes " tName":))))

Truly! Thank you, that helped!

Can I ask you another question?

Is it possible to read the value of "buy/sell" item in EA settings? (so the program works differently depending on this setting).
 
Pyro:

Please advise, there is a function for drawing a label:

When the function is called twice in a row (I want to draw two labels in different places), only the last one remains:

void RightText(int tWindow, string tName, string tText, int tCorner, int tX, int tY, int tFontsize, color tColor)
{
ObjectCreate (tName,OBJ_LABEL, 0,0,0);              // Создание объекта
ObjectSetText(tName,tText);
ObjectSet    (tName,OBJPROP_CORNER, tCorner);       // Привязка к углу
ObjectSet    (tName,OBJPROP_XDISTANCE, tX);         // Отступ по горизонтали 
ObjectSet    (tName,OBJPROP_YDISTANCE, tY);         // Отступ по вертикали
ObjectSet    (tName,OBJPROP_COLOR,tColor);          // Цвет обьекта
ObjectSet    (tName,OBJPROP_BACK, true);            // Background 
ObjectSet    (tName,OBJPROP_FONTSIZE, tFontsize);   // Fontsize
}         

Try that and you'll be fine.
 

todem


Thanks, got it figured out :)

 
346206:

This is some kind of nonsense. I can't attach the Zig-Zag to the graphic. Can anyone tell me what the problem is?

Try compiling it.
 

Faced the following problem. I have written a simple Expert Advisor. I start it in the strategy tester. I have only run it through March 2011 and received 21 orders. I have run it for the period from April 2010 to March 2011 and received only 5 orders.

I understand that if I run it for a longer period, it should give me either more or equal 21 orders. But I got less.

Why can it happen? How to fix this problem? Please, advise.