Required AFL Codes for displaying "Today's Bar Numbers" on Each of Candles on Charts..

#11
Don't mix this with the original afl. I'm sharing it as a separate set of code so that you can write one to meet your needs using this as reference.

Code:
h_l_font = paramstr("Font for High/Low", "Corbel");
h_l_font_size = param("Font size for High/Low", 8, 1, 10, 1);
h_l_color = paramcolor("Color for High/Low", colorgrey40);
h_l_align = param("Alignment for High/Low", 30, 0, 100, 1);
h_l_angle = param("Angle for High/Low", 0, 0, 3600, 1);
h_offset = param("High offset", 1, 0, 200, 1);
l_offset = param("Low offset", 1, 0, 200, 1);

gfxsetbkmode(1);
gfxsetcoordsmode(1);
gfxsettextalign(h_l_align);
gfxsettextcolor(h_l_color);
gfxselectfont(h_l_font, h_l_font_size, 400, false, false, h_l_angle);

first_visible_bar = status("firstvisiblebar");
last_visible_bar = status("lastvisiblebar");

for (i = first_visible_bar; (i < last_visible_bar) and (i < barcount); i++) {
    x = i;
    y_h = h[i] + h_offset;
    y_l = l[i] - l_offset;

    gfxtextout(strformat("%.2f", h[i]), x, y_h);
    gfxtextout(strformat("%.2f", l[i]), x, y_l);
}
 

pkgmtnl

Well-Known Member
#12
Thank
Don't mix this with the original afl. I'm sharing it as a separate set of code so that you can write one to meet your needs using this as reference.

Code:
h_l_font = paramstr("Font for High/Low", "Corbel");
h_l_font_size = param("Font size for High/Low", 8, 1, 10, 1);
h_l_color = paramcolor("Color for High/Low", colorgrey40);
h_l_align = param("Alignment for High/Low", 30, 0, 100, 1);
h_l_angle = param("Angle for High/Low", 0, 0, 3600, 1);
h_offset = param("High offset", 1, 0, 200, 1);
l_offset = param("Low offset", 1, 0, 200, 1);

gfxsetbkmode(1);
gfxsetcoordsmode(1);
gfxsettextalign(h_l_align);
gfxsettextcolor(h_l_color);
gfxselectfont(h_l_font, h_l_font_size, 400, false, false, h_l_angle);

first_visible_bar = status("firstvisiblebar");
last_visible_bar = status("lastvisiblebar");

for (i = first_visible_bar; (i < last_visible_bar) and (i < barcount); i++) {
    x = i;
    y_h = h[i] + h_offset;
    y_l = l[i] - l_offset;

    gfxtextout(strformat("%.2f", h[i]), x, y_h);
    gfxtextout(strformat("%.2f", l[i]), x, y_l);
}
Thank you so much, you are very generous and helpful, Appreciated.
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?