ObjectSet("EntryButton", OBJPROP_XDISTANCE, HighPrice); ObjectSet("EntryButton", OBJPROP_YDISTANCE, StartTime);Anchor points (x,y) are pixels, not price or time.
Thanks for the comment.
I changed it to:
ObjectSet("EntryButton", OBJPROP_PRICE, HighPrice);
ObjectSet("EntryButton", OBJPROP_TIME, StartTime);
But the Button is static and not at the right place.
I suggest you read the documentation again.
A button graphic object is anchored by the x,y pixel coordinates: OBJPROP_XDISTANCE, OBJPROP_YDISTANCE (see William's post #1)
It does not use price or time coordinates or properties.
Theoretically yes, but not at all practical. You would have to keep track of chart shifts in time and price constantly with chart events and constantly adjust.
Instead use other types of graphical objects that can be anchored to price/time and react to mouse click events on those objects instead, to change their states or visual appearances to mimic the functionality of a button. It will be simpler and easier than trying to convert x,y to price/time for a button object.
Perhaps you should read the manual.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
You used ChartXYToTimePrice in your code. “Is there a way?” ChartTimePriceToXY
Theoretically yes, but not at all practical. You would have to keep track of chart shifts in time and price constantly with chart events and constantly adjust.
Instead use other types of graphical objects that can be anchored to price/time and react to mouse click events on those objects instead, to change their states or visual appearances to mimic the functionality of a button. It will be simpler and easier than trying to convert x,y to price/time for a button object.
You are right. I used the ChartTimePriceToXY but the button is constantly adjusting with chart shifts.
Can you please suggest the most appropriate graphical object that I can use.
That is up to you what type of visual you what to have. There are rectangles, triangles, elipses, arrows, text, bitmaps, etc.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to set a button at the high of a specific candle with a double click.
The button is not showing up. Can someone please advise what is wrong with the attached code.