NexusFi: Find Your Edge


Home Menu

 





a small help in afl rectangle programming....


Discussion in Platforms and Indicators

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




 
Search this Thread

a small help in afl rectangle programming....

  #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?
What broker to use for trading palladium futures
Commodities
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts