NexusFi: Find Your Edge


Home Menu

 





a small help in afl rectangle programming....


Discussion in Platforms and Indicators

Updated
    1. trending_up 3,170 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
mady72
Ludhiana + India
 
Posts: 9 since Oct 2015
Thanks Given: 2
Thanks Received: 0

I wish to create a rectangle box on my chart in AMIBROKER which changes color according to time i.e from 9:40 to 10:00am its color remain green and after that it changes to blue.

GfxSelectSolidBrush( colorBlue );//for rectangle color

x = 1050;
x2 = x-180;
y = 130;
GfxRectangle(x, y - 70, x2, y);//for displaying rectangle on chart

Also if rectangle box could move up and down i.e 9:40 to 10:00am value of y should be equal to 90 and after that it becomes 130 again.

I dont know if i m asking something stupid... But if it is possible then plz help..


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
CFTC Launches Innovation Task Force for AI Trading Syste …
Traders Hideout
CFTC Requests Tag 50 Trader Identity Data From CME and I …
Traders Hideout
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
I Have a Thing Called Iran -- Trump Stays in DC as Airsp …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #2 (permalink)
JFDerzi
Belo Horizonte, MG/Brazil
 
Posts: 11 since Mar 2015
Thanks Given: 0
Thanks Received: 13

In fact, that is easy.

I wonder why you did not get an answer so far.

You will have to use NOW().

Now(4) return the current time in TIMENUM() format.
I also can't post links yet.

So:

if( now(4) >= 094000 and now(4) <= 100000)
{
Ret_color = colorGreen;
y = 90
}
else
{
Ret_color = colorBlue;
y = 130
}

GfxSelectSolidBrush( Ret_Color );//for rectangle color

x=1050
x2 = x-180;

GfxRectangle(x, y - 70, x2, y);//for displaying rectangle on chart


Reply With Quote
Thanked by:
  #3 (permalink)
JFDerzi
Belo Horizonte, MG/Brazil
 
Posts: 11 since Mar 2015
Thanks Given: 0
Thanks Received: 13


I just remembered, I leaned a lot from these two examples.

wisestocktrader.com/indicators/3709-button-control-panel]Download Button control panel For Amibroker (AFL)

amibroker.org/userkb/2008/03/06/introduction-to-real-time-control-panels/]AmiBroker Users? Knowledge Base » Introduction to Real-Time Control-Panels


(I still can't post links, newbie limitations).


Reply With Quote
Thanked by:
  #4 (permalink)
mady72
Ludhiana + India
 
Posts: 9 since Oct 2015
Thanks Given: 2
Thanks Received: 0

Thanx for d help.I have been waiting for it from so long. I m a newbie to Amibroker, can do basic programing but i was not able to do this one, but after ur help it should work.... I will put it in my afl and would let u knw how it performed. Thank u so very much..

Mady.....




JFDerzi View Post
In fact, that is easy.

I wonder why you did not get an answer so far.

You will have to use NOW().

Now(4) return the current time in TIMENUM() format.
I also can't post links yet.

So:

if( now(4) >= 094000 and now(4) <= 100000)
{
Ret_color = colorGreen;
y = 90
}
else
{
Ret_color = colorBlue;
y = 130
}

GfxSelectSolidBrush( Ret_Color );//for rectangle color

x=1050
x2 = x-180;

GfxRectangle(x, y - 70, x2, y);//for displaying rectangle on chart


Reply With Quote
  #5 (permalink)
mady72
Ludhiana + India
 
Posts: 9 since Oct 2015
Thanks Given: 2
Thanks Received: 0

I will look into d formula's and d amibroker article... Thanx again...


JFDerzi View Post
I just remembered, I leaned a lot from these two examples.

wisestocktrader.com/indicators/3709-button-control-panel]Download Button control panel For Amibroker (AFL)

amibroker.org/userkb/2008/03/06/introduction-to-real-time-control-panels/]AmiBroker Users? Knowledge Base » Introduction to Real-Time Control-Panels


(I still can't post links, newbie limitations).


Reply With Quote




Last Updated on March 29, 2016


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts