Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 480

 
khorosh:

Probably because the build is old and the MQL4 editor is new. Does it compile without errors?

No errors.

Is this the 600 build now?

 
charter:

No mistakes.

So it's 600 build now?


Must be 604 last.
 

Strangely, it didn't automatically update for me.

Downloaded it from the Metacvots. Turns out the build is already 604

 
I think that's the problem. Thank you.
 

Mastering the structures. Writing:

//в шапке
struct move{
   int nBar;
   double price;
};
struct edge{
   move L0;
   move R1;
};
struct set{
   color RGB;
   int width;
   int style;
   bool back;
};
//пользовательская функция
void plot(string name, long current_chart_id, edge &x, set &y){
   if(ObjectFind(name) == -1){
      ObjectCreate(current_chart_id, name, OBJ_TREND, 0, Time[x.L0.nBar], x.L0.price, Time[x.R1.nBar], x.R1.price);
      ObjectSet(name, OBJPROP_COLOR, y.RGB);
      ObjectSet(name, OBJPROP_WIDTH, y.width);
      ObjectSet(name, OBJPROP_STYLE, y.style);
      ObjectSet(name, OBJPROP_BACK, y.back);
      ObjectSet(name, OBJPROP_RAY, false);
   }else{
      ObjectMove(current_chart_id, name, 0, Time[x.L0.nBar], x.L0.price);
      ObjectMove(current_chart_id, name, 1, Time[x.R1.nBar], x.R1.price);
   }
   return;
}
//в OnTimer()
edge x = {{fstBar - length1, price1}, {length2, price2}};
set y = {cPrice[int(!IsCall)], 1, STYLE_DOT, true};
plot(name, current_chart_id, x, y);

- The compiler swears that I can only pass constants. How do I pass variables in a structure?

Added by

Found a solution :

x.L0.nBar = fstBar - length1; x.L0.price = price1; x.R1.nBar = length2; x.R1.price = price2;
y.RGB = cPrice[int(!IsCall)]; y.back = true; y.style = STYLE_DOT; y.width = 1;
plot(name, current_chart_id, x, y);

Got it, only constants can really be in curly braces.

 
Is it possible to use MQL to write the csv file to a specific cell, or how can the file be formatted as a table?
 
Please draft an example of how to set any icon ... I took a function from Kim's setArrow and I guess I passed the wrong parameters because icons are either drawn in a line or not drawn at all
 
Zver4991:
Please draft an example of setting any icon... I took the setArrow function from Kim... I must be passing wrong parameters because the icons are either drawn in a line or are not drawn at all...

The price is correct. If all objects are on one line, they are lined up at the same price.
 
beginner:
Is it possible to write information into csv file using MQL tools in a certain cell or how to format a file as a table?

Two ways.

1. Read the file into an array. Edit the array as needed, then overwrite the file with this array.

2. Calculate position for the file pointer to the beginning and the end of the data to be rewritten. We read the end part into the buffer and save it. Then we overwrite what was needed. Then we finish writing from the buffer with what we had read and remembered earlier.

 

Hi all!

Has anyone tried to measure the angle of the moving average? I need to measure it, but don't know which direction to start digging.

Reason: