Re: [amibroker] Re: Rectangle with price label.

 

Yes, the rectangles can (and should) be locked on an specific symbol.

What I would do is to store their coordinates on persistent staticvars, named like:

Name() + "X1_" + rectangle number
Name() + "Y1_" + rectangle number

and X2, Y2 as well.

The function Name() return the symbol name (just in case ou don't know).


So every symbol would have its own rectangles. Changing symbol would change all rectangles on the chart.

Two paramtoggles would be necessary: "Delete all Rectangles from this Symbol" and "Delete all Rectangles from all symbols".

I gave it a thought and just using staticvars it is possible to store an infinite number of rectangles. 
It is just necessary a rectangle counter (  Name() + "RecNumber"  ).

So, we can restore all rectangles just reading the variable from 1 to RecNumber.

If  a single rectangle is deleted, the RecNumber will remain unchanged but that rectangle coords would be filled with NULL or 0, and would not be drawn by the AFL.


But, being a Supply / Demand trader, do you prefer rectangles or levels?

And, I think it´s nice to display the rectangle or level amplitude.



This is an example of a level AFL that I use:




The red circle shows what defined the level.
The yellow circle is the amplitude (good to calculate R:R).




2016-05-23 10:46 GMT-03:00 jawakow jawakow@yahoo.pl [amibroker] <amibroker@yahoogroups.com>:
 

Hi João,

thanks for a tips, I'm a supply/demand trader and using rectangles to draw zones. If am I now wrong, studies drawn by AFL will stay on a chart even when you switch to another instument? I don't think so that GFX plots can be locked to specified intrument.

I'll make a short video about my progress :)

Snapping to open/close works if 'o' or 'c' key if pressed (if Snap to price enabled).

Thanks again

Luke

On 21/05/2016 07:15, João Flávio Machado Derzi joaoderzi@gmail.com [amibroker] wrote:
 
Luke, 

about the rectangles, I believe it will be easier to create an AFL where you draw them using Ctrl+Left Mouse Button, for example.

Much easier and faster than create studies and fill IDs.

It is easy to code, specially when using a limited max number of rectangles per symbol (3, 5...).

For an unlimited number, it is a little harder depending of how you wanna the AFL to behave.
You would have to use static arrays to store the rectangles instead of static variables. If you delete one rectangle you should rearrenge the array. Not a big deal but harder than only test 5 staticvars.

I can give you a hand but I will be really busy until the 25th.

If you wanna do it by your own, search for "Vertical Study Line instead of SelectedValue, BeginValue, EndValue".
Somewhere there, there is a code I made that shows some basics about getting the mouse clicks and position.


About the open/close, some tools like trendlines already do that.
If that is not enough you can use the option Format / Snap to price. It will help a lot.
Be sure to fill the Tick Size on the Symbol information window.

There is a current thread about it.



2016-05-19 14:40 GMT-03:00 Lukasz Kubisz jawakow@yahoo.pl [amibroker] <amibroker@yahoogroups.com>:
 

All rectangles are drawn manually. I've managed to get lines with prices by retrieving study coordinates by AFL, but that requires different study ID for every study and duplicate functions in AFL. Is there any chance to change study properties by AFL?


Another off topic question: is snapping to bar open/close possible? 

Thanks. 

Luke 


 
How the rectangles are drawn, manually or AFL created?


2016-05-17 10:18 GMT-03:00 Sab Nys sabnys@yahoo.com [amibroker] <amibroker@yahoogroups.com>:
 

>>  It seems that inline pictures are not displaying

Maybe try Thunderbird.


On 17/05/2016 2:08 PM, jawakow@yahoo.pl [amibroker] wrote:
 









--
Agradeço antecipadamente,

----------------------------------------------------------
João Flávio Machado Derzi
+55 (31) 9731-4469





--
Agradeço antecipadamente,

----------------------------------------------------------
João Flávio Machado Derzi
+55 (31) 9731-4469

__._,_.___

Posted by: =?UTF-8?Q?Jo=C3=A3o_Fl=C3=A1vio_Machado_Derzi?= <joaoderzi@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (10)

Check out the automatic photo album with 1 photo(s) from this topic.
gjaaihad.png

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon