This peace of code show an up or down arrow depend of what pair u attach the indicator to.
When i change Dol to "down" instead of "up" the arrow should show the opposite direction, but it doesn't.
If i i.e. attach the indicator to a NZDUSD chart and if Dol is set to "up" it should show a down arrow on the NZDUSD chart and it i set it to down it should show a up arrow, but it still show a down arrow.
Can anyone see what wrong in this code?
When i change Dol to "down" instead of "up" the arrow should show the opposite direction, but it doesn't.
If i i.e. attach the indicator to a NZDUSD chart and if Dol is set to "up" it should show a down arrow on the NZDUSD chart and it i set it to down it should show a up arrow, but it still show a down arrow.
Can anyone see what wrong in this code?
Inserted Code
string pair = Symbol();
string Dol = "down";
string Pre=StringSubstr(pair,0,3);// Extract first 3 symbols
if((Pre == "EUR") || (Pre == "GBP") || (Pre == "AUS") || (Pre == "NZD") || (Pre == "XAG") || (Pre == "XAU") || (Pre == "BTC") && (Dol == "up"))
{
//--- indicator buffers mapping
ObjectCreate("signal",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal",OBJPROP_CORNER,3);
ObjectSet("signal",OBJPROP_XDISTANCE,10);
ObjectSet("signal",OBJPROP_YDISTANCE,-5);
// use symbols from the Wingdings font
ObjectSetText("signal",CharToStr(234),50,"Wingdings",Black); //234 - Down
}
else
{
ObjectCreate("signal",OBJ_LABEL,0,0,0,0,0);
ObjectSet("signal",OBJPROP_CORNER,3);
ObjectSet("signal",OBJPROP_XDISTANCE,10);
ObjectSet("signal",OBJPROP_YDISTANCE,5);
// use symbols from the Wingdings font
ObjectSetText("signal",CharToStr(233),50,"Wingdings",Black); //233 - Up
} Blindly following others will make you blind!