I am trying to code an EA to produce up/down arrows on the chart when a pin bar has formed. My experience to this point with objects is limited. The following code is what I have come up with so far:
double dstup, dstdn;
if(PinBar == "UP") dstup = (iHigh(NULL, EATF5, 1) + 0.0010);
if(PinBar == "DOWN") dstdn = (iLow(NULL, EATF5, 1) - 0.0010);
ObjectDelete("PinDown");
ObjectCreate("PinDown", OBJ_ARROW, 0, 0, dstdn);
ObjectSet("PinDown", OBJPROP_COLOR, LimeGreen);
ObjectSet("PinDown", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("PinDown", OBJPROP_WIDTH, 2);
ObjectSet("PinDown", OBJPROP_BACK, True);
ObjectDelete("PinUp");
ObjectCreate("PinUp", OBJ_ARROW, 0, 0, dstup);
ObjectSet("PinUp", OBJPROP_COLOR, Red);
ObjectSet("PinUp", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("PinUp", OBJPROP_WIDTH, 2);
ObjectSet("PinUp", OBJPROP_BACK, True);
It compiles, but nothing appears on the chart. Any help from anyone would be greatly appreciated!
double dstup, dstdn;
if(PinBar == "UP") dstup = (iHigh(NULL, EATF5, 1) + 0.0010);
if(PinBar == "DOWN") dstdn = (iLow(NULL, EATF5, 1) - 0.0010);
ObjectDelete("PinDown");
ObjectCreate("PinDown", OBJ_ARROW, 0, 0, dstdn);
ObjectSet("PinDown", OBJPROP_COLOR, LimeGreen);
ObjectSet("PinDown", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("PinDown", OBJPROP_WIDTH, 2);
ObjectSet("PinDown", OBJPROP_BACK, True);
ObjectDelete("PinUp");
ObjectCreate("PinUp", OBJ_ARROW, 0, 0, dstup);
ObjectSet("PinUp", OBJPROP_COLOR, Red);
ObjectSet("PinUp", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("PinUp", OBJPROP_WIDTH, 2);
ObjectSet("PinUp", OBJPROP_BACK, True);
It compiles, but nothing appears on the chart. Any help from anyone would be greatly appreciated!