how to repeat horizontal line or how to create loop for horizontal line
-
hello everyone, im trying to loop a horizontal line 10 times. for example every 10 pips draw a horizontal trendline . for example price goes above first trendline draw the second trendline 10 pips away and repeat this steps 10 times for example. is there an easier way as to copy condition 10 times?
thank you
-
@akallai86 Not sure if I fully understand. Do you mean 10 lines are drawn on the chart at the same time? Or just one only line at a time but no more than 10 times? I guess it's the second one but then I don't get what happens after 10 times. Could you please explain?
-
double price;
for (int i = 0; i < v::MaxPositions; i++)
{
price = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_BID),_Digits); // Obtener el precio actual del Bid
price = price - v::distance;
// Crear una línea horizontal en el precio "price" con grosor de 0.5 y color verde
string lineName =ObjectCreate(0,"Position " + IntegerToString(i),OBJ_HLINE,0,0,price);
ObjectSetInteger(0, "Position " + IntegerToString(i), OBJPROP_COLOR, Red);
ObjectSetInteger(0, "Position " + IntegerToString(i), OBJPROP_WIDTH, 0.5);
}