PDA

View Full Version : Graphic Objects and co ordinates.



Edakad
06-14-2014, 05:35 AM
Hello

So far I have found the following method to plot an arrow.


AddObject 0, "Obj1", OBJ_ARROW_SELL, 0, GetTime(0,bars(0)), GetHigh(0,bars(0))Except the label object, other object co-ordinates are in terms of time and price. I want to plot an arrow, the big red one in the right margin, as shown in the below image.

The arrow will remain in this place always and change color based on some criteria. The issue I am facing is How to specify the co-ordinates in terms of pixels (to make the arrow permanent at a point). Is there any other way of plotting an arrow or any shapes in chart other than the addObject and bitmap?

344

Thanking You

Edakad
06-14-2014, 09:08 AM
Another query is Is there any method to add wingdings to string and display it on chart with CreateObjectLabel

Hassan-HS
06-14-2014, 09:46 AM
Hello,



So far I have found the following method to plot an arrow.

Code:
AddObject 0, "Obj1", OBJ_ARROW_SELL, 0, GetTime(0,bars(0)), GetHigh(0,bars(0))
Except the label object, other object co-ordinates are in terms of time and price. I want to plot an arrow, the big red one in the right margin, as shown in the below image.

The arrow will remain in this place always and change color based on some criteria. The issue I am facing is How to specify the co-ordinates in terms of pixels (to make the arrow permanent at a point). Is there any other way of plotting an arrow or any shapes in chart other than the addObject and bitmap?

There is no method that adds a object to the chart according to X,Y dimensions except CreateObjectLabel


Another query is Is there any method to add wingdings to string and display it on chart with CreateObjectLabel

No, but I will manage to this feature in next patches.

Edakad
06-15-2014, 07:38 AM
Thanks Hassan

Hassan-HS
06-16-2014, 12:26 PM
Hello,



Please check this code, that attach arrows on the chart based ob X,Y axis.



Public Sub main()

ObjectDeleteAll 0
iobjID = "lblText" ' ID of the label object

XPos = 10 ' X position on chart

YPos = 180 ' Y position on chart

objText="Text goes here." ' Sets the text of the label.

CreateObjectLabel 0,0,CSTR(objID),CINT(XPos),CINT(YPos),"hipq"
'Creates the label with the selected parameters

ObjectSetText 0, CSTR(objID),CINT(15),Cstr("Wingdings 3"),CLNG(RGBColor(255,00,0)) ' Sets the label properties.

End Sub




check this image it will help you.
345

Edakad
06-17-2014, 05:56 PM
Thanks Hassan