Draw a line at EA
Draw a line with EA
I had a hard time because there were not many reference materials.
The reference page only has a sample as a function,
While disassembling the function, I forcibly stored it.
Please refer to the sample below.
// Data variable declaration
datetime date [];
// Substitute continuous date data for date []
if (CopyTime (Symbol (), Period (), 0,100, date) == -1) {}
//Variable declaration
int d1 = 0;
int d2 = 100;
// Variable declaration Display Y-axis value
double kekka [5] [5];
kekka [0] [0] = // Display right end value
kekka [0] [1] = // Display left end value
// OBJ_TREND Draw a line between two points
For more information, https://www.mql5.com/ja/docs/objects/objectcreate
// Function to write a line
ObjectCreate (0, “HLine”, OBJ_TREND, 0, date [d1], kekka [0] [0], date [d2], kekka [0] [1]);
that’s all
Share this content:
コメントを残す