I'm making a huge indicator and don't want to copy this code hundreds of times if the logic is wrong. I'm trying to create a colored "+" based on the difference between close prices on candles. If the close of one bar is above the close of the other, it should create a green "+." If the most recent bar closes below the close of the previous candle, the symbol should be red. If the two close values are the same, the "+" symbol should be white.
I think my logic is correct here but just wanted someone to look over it before I spend hours copying and modifying it for use with other pairs and TF's. The symbols are all showing up white even though my most recent price data from Friday afternoon shows the signals should either be red or green, not white. Is this because the price feed is not available right now over the weekend? Do I have to wait until the price feed returns before it will signal correctly? Or is there a flaw in my code here?
Thanks in advance!
I think my logic is correct here but just wanted someone to look over it before I spend hours copying and modifying it for use with other pairs and TF's. The symbols are all showing up white even though my most recent price data from Friday afternoon shows the signals should either be red or green, not white. Is this because the price feed is not available right now over the weekend? Do I have to wait until the price feed returns before it will signal correctly? Or is there a flaw in my code here?
Thanks in advance!
Inserted Code
if ((iClose("AUDCAD",PERIOD_M1,1)) > (iClose("AUDCAD",PERIOD_M1,2))) { AUDCAD_M1_a= "+"; x = 120; color_indic = Lime;} if ((iClose("AUDCAD",PERIOD_M1,1)) < (iClose("AUDCAD",PERIOD_M1,2))) { AUDCAD_M1_a= "+"; x = 120; color_indic = Red;} if ((iClose("AUDCAD",PERIOD_M1,1)) == (iClose("AUDCAD",PERIOD_M1,2))) { AUDCAD_M1_a= "+"; x = 120; color_indic = White;} ObjectCreate("objACAD_m1_a", OBJ_LABEL, WindowFind(" +"), 0, 0); ObjectSetText("objACAD_m1_a",AUDCAD_M1_a,7, "Verdana", color_indic); ObjectSet("objACAD_m1_a", OBJPROP_CORNER, 0); ObjectSet("objACAD_m1_a", OBJPROP_XDISTANCE, x); ObjectSet("objACAD_m1_a", OBJPROP_YDISTANCE, 170); if ((iClose("AUDCAD",PERIOD_M1,2)) > (iClose("AUDCAD",PERIOD_M1,3))) { AUDCAD_M1_b= "+"; x = 128; color_indic = Lime;} if ((iClose("AUDCAD",PERIOD_M1,2)) < (iClose("AUDCAD",PERIOD_M1,3))) { AUDCAD_M1_b= "+"; x = 128; color_indic = Red;} if ((iClose("AUDCAD",PERIOD_M1,2)) == (iClose("AUDCAD",PERIOD_M1,3))) { AUDCAD_M1_b= "+"; x = 128; color_indic = White;} ObjectCreate("objACAD_m1_b", OBJ_LABEL, WindowFind(" +"), 0, 0); ObjectSetText("objACAD_m1_b",AUDCAD_M1_b,7, "Verdana", color_indic); ObjectSet("objACAD_m1_b", OBJPROP_CORNER, 0); ObjectSet("objACAD_m1_b", OBJPROP_XDISTANCE, x); ObjectSet("objACAD_m1_b", OBJPROP_YDISTANCE, 170);