ObjectCreate Failed! Why?
Posted: Thu Dec 27, 2012 1:19 am
Hi, Kelvin or Phil:
Hope that you've enjoyed a great holiday! and also by chance see my post
I am still working on my delphi strategy and stuck at the ObjectCreate command
I only attached the "procedure" instead of the whole program.
the log shows all print() info as success/true except objectcreate only returning [obj NOT created]. and I don't know why. I also used [ObjectCreate(ObjHUDline1, OBJ_TEXT, 0, 0, 0)], not working either...
I also desperately tried 1, 2, and 3 for [OBJPROP_SCREENCOORDS] line, it should not affect objectcreate anyway, and it didn't.
on the currency chart, I do have one RSI and one ATR indicators. will that be the cause?
Many thanks in advance!
Hope that you've enjoyed a great holiday! and also by chance see my post
I am still working on my delphi strategy and stuck at the ObjectCreate command
I only attached the "procedure" instead of the whole program.
the log shows all print() info as success/true except objectcreate only returning [obj NOT created]. and I don't know why. I also used [ObjectCreate(ObjHUDline1, OBJ_TEXT, 0, 0, 0)], not working either...
I also desperately tried 1, 2, and 3 for [OBJPROP_SCREENCOORDS] line, it should not affect objectcreate anyway, and it didn't.
on the currency chart, I do have one RSI and one ATR indicators. will that be the cause?
Many thanks in advance!
Code: Select all
procedure HUDprojector1(note:string; colorcode: Tcolor; timecoord: integer; pricecoord: integer);
begin
if SetCurrencyAndTimeframe(sym[1], 60) then print(sym[1] + ' is set for HUD().')
else print('sym[1] is NOT set!');
if ObjectCreate(ObjHUDline1, OBJ_TEXT, 0, Time(0), High(0)) then print('obj created')
else print('obj NOT created');
if ObjectSetText(ObjHUDline1, note, 9, 'Arial', colorcode) then print('text set')
else print('text NOT set');
if ObjectSet(ObjHUDline1, OBJPROP_SCREENCOORDS,3) then print('corner set')
else print('corner NOT set');
if ObjectSet(ObjHUDline1, OBJPROP_TIME1, timecoord) then print('timecorrd set')
else print('timecorrd NOT set');
if ObjectSet(ObjHUDline1, OBJPROP_PRICE1,pricecoord) then print('pricecorrd set')
else print('pricecorrd NOT set');
end;