For the arrows, since you are not deleting the arrow in advance, the ObjectCreate() will fail if it already exists. If it does fail, it won't change the time/price. You should get error messages in the log, however.jjasper7 wrote:can anyone observe what i am doing wrong in these code snippets? the wingdings and lines sometimes show but more often do not. their values do show up in the objects list, but are frequently not painted. and no code differences between when they paint and when they fail.
-------------------------------------------
void MarkV( string name, double price, int bar, int wingdng, color colr)
{
// wingdings: 228/230 buy/sell arrows,
// colors; buy/sell Aqua/Maroon
name=name+bar;
ObjectCreate(name ,OBJ_ARROW,0,Time[bar],price);
ObjectSet(name,OBJPROP_ARROWCODE,wingdng);
ObjectSet(name,OBJPROP_COLOR,colr);
}
// ex. MarkV("mtm5", Low[1], 0, 190, Black);
------------------------------
void DrawLine(string name, datetime time1, double val1, datetime time2, double val2, color col, int width, int style, bool ray)
{
//Plots a line with the given parameters
ObjectDelete(name);
ObjectCreate(name, OBJ_TREND, 0, time1, val1, time2, val2);
ObjectSet(name, OBJPROP_COLOR, col);
ObjectSet(name, OBJPROP_WIDTH, width);
ObjectSet(name, OBJPROP_STYLE, style);
ObjectSet(name, OBJPROP_RAY, ray);
}//End void DrawLine()
// ex. DrawLine("ttnl "+Bars, Time[3], High[3], Time[2],High[3]+2*spread, Brown, 2, STYLE_SOLID, false);
// ex2. DrawLine(" Aline ", Time[startA],Avalue, Time[0],Avalue, Brown, 3, STYLE_SOLID, false);
Another possibility is that the objects are not appearing because you have something else on the screen like iParamWorktime drawing a rectangle that is higher in the z-order because of it's name so it is on top of the objects you are drawing. I posted somewhere on here about the order of visible objects based on their name. I'll see if I can find it and update this post if you think that might be the case.
George