Using the following code ( C++ API 1.10 ):
Code: Select all
if( !ObjectExists(objName) )
{
ObjectCreate(objName, obj_Text, 0, Time(0), value );
std::stringstream t;
t << " " << text << " " << setiosflags(ios::fixed) << setprecision( precision ) << value;
ObjectSetText(objName, t.str(), fontSize, "Tahoma", color);
ObjectSet(objName, OBJPROP_VALIGNMENT, tlCenter);
ObjectSet(objName, OBJPROP_HALIGNMENT, taLeftJustify);
} else {
std::stringstream tt;
tt << " " << text << " " << setiosflags(ios::fixed) << setprecision( precision ) << value;
ObjectSetText(objName, tt.str(), fontSize, "Tahoma", color);
ObjectSet(objName,OBJPROP_TIME1, Time(0) );
ObjectSet(objName,OBJPROP_PRICE1, value );
}
Creates text on the chart, however this text appears on all time frames and not just on the time frame where the object was created for.
This looks inconsistent with how all the indicators work on a single time frame.
How to avoid this behavior? Or is this a bug that text objects appear on all time frames
Wessel[/i]