Using mouse button clicks to set pivots for Fibonacci retracements / extensions


Thanks for all the feed back, definitely helps in the AFL learning curve.

However the issue remains - no one has provided a solution to the questions I have asked !

What I have learnt is how to post a "screen clip" of a chart and soon I may also be able to post a video clip -
does not help in learning AFL.

I know I have very limited programming skills !

I only come to the forum after - "supply of paracetamol runs low / very few hair left - cause I have pulled them out / no coffee left / dog refuses to go for a walk", so guys my request to all of you is to provide a solution to my query so that I may progress on the AFL learning curve.

thanks for the guidance, warm regards

@JEETU In your Code example you are using SelectedValue() and that is fine.
But now the program need to remember what you select, and for that reason you need this specific X or Y Value to store in static variable, or in a ascii file.
In your case here you NEED to store both X-axis and Y-axis.

@Milosz gave you many links… I don’t know if you bought already new box of tea or coffee? But before you run out again, you have to focus on StaticVariables

It is very easy to write this code that you are looking for.
If you stuck somewhere let us know, and came back with more charting ideas.
Happy coding


Thanks, you guys are great, always nudging but not providing the solution.
If you provide the solution I will not learn anything -- this way, with trial and error I
will learn and it will stay with me - once again thanks to you and MIosz.

Ya , from what little I have learnt, I was inclined towards "functions" and "static variables" - still
trying to understand their use.

Coffee is out and has been replaced with herbal ( Ginseng) green tea.

Once again thanks for your guidance .

Hellow Milosz,
Can you please share the afl code for drawing fibonacci time extensions & arcs ( as shown in the above display).
Thanks in advance

Hellow Milosz, Basically i am looking AFL code which draws fibonacci time extensions & fibonacci fans automatcally. ( not fibonacci arc)

Thank you so much PanoS. This gives good break though for my current development.
I was actually looking for topic where AFL identifies the drag and drop of a drawing.
This helped Me.

Main idea is to create an AFL which triggers the order placing API functions based on line position(Like in TV, we can modify the order entry price(Limit), Stop loss and Target order by moving the horizontal line on the chart).

Everyone please direct me if we have any blogs already related to the topic i mentioned.

Thank you for your time.


If you go to Amibroker menu > insert > BUY Line ,SELL line exist already If you are with interactive Brokers.

I don’t know your afl coding background and how exactly you imagine to make your tool.

But If you are looking for a GFX button like this. It is already exist from a Amibroker Member.

If you looking just mouse clicks on the chart let me know.

Also in the amibroker member area must be few afl there

Thank you @PanoS.

I am not using IB so can't make use of the option.
and i am a programmer its been few months i started with AFL gone though all the standard documentation and have decent hands on with AFL.

My requirement is, on click of a button based on the LTP i want to place BUY, SL and Target lines(with buttons), on click of buttons(which are on the lines) i want to manage the order placement and option to move the individual line on chart.

In this i can handle the order management part as i already have API and development exposure on it.
Regarding the Mouse clicks for the i got below Blog and will try to understand code and try to get back if any doubts, Thank you.

GetCursorYPosition() on GuiButton