Adding items to the right click menu

I'm developing a way to trade from the chart, based on the IB add-on.
Is there a way to add extra items to the Right Mouse Click on the chart?
I would like to add option to Buy, Short and Close for the currently-displayed instrument.
Wondering if this is possible. similar to Ninja Trader.

Many thanks,
Polomora

Check out GUI controls of AmiBroker 6.3

https://www.amibroker.com/guide/h_gui.html

I'm already aware of the GUI controls, and am already using them. To reduce screen clutter, I would like to use RMB menu items.
Is this possible?

No, you can't add items to RMB chart menu. But you may go to tools, customize, toolbars and check "Order" item. It will make order buttons showing on menu bar. Click buy or sell button then left click on chart. Order window will open. IB controller must be installed to send orders.

@polomora - I agree with @codejunkie. Using Gfx functions you can achieve whatever you want. There are no constraints.

Also remember that apart from very useful GuiButtons - since AB 6.29, you can also have up to 20 multifunctional custom toolbar buttons:

1

See here:

If you like such small icons, you can also easily display them on the chart - using GfxDrawImage() - and in this case you can have them as many as you like. Using GetCursorMouseButtons() and GetCursorXPosition + GetCursorYPosition you can easily convert them into your custom buttons. They can be always visible or hidden and displayed only when needed.

Summing up, you can easily create your own custom gfx menus and you have lots of possibilities when it comes to the look and functioning.

2 Likes

It is very bad idea to create "add-ons" that modify native UI of AmiBroker as it presents support nightmare and forward compatibility risk (what would happen with your addon if we decide to change our menus?)

As long as people are customizing the UI of their installation it is OK (because the person is aware that he modified the UI him/herself).
But installing add-ons that change the UI for other people without them being aware what happened is bad.

So no, don't attempt to modify native right click menu. Use provided tools for creating UI as advised already in this thread.