Arrow Codes
An arrow code picks the symbol drawn by an arrow buffer (arrow_code in display) and by draw.Symbol. There are 224 codes, 32 to 255, laid out like a classic symbol font. 44 of them also have a name (Arrow.Up, Arrow.Star …).
Using a Code
A code can be a number or an Arrow.* name, wherever a code is accepted. Arrow.* names are ordinary int constants in script code too.
// 1. An arrow buffer in display { }
display {
outputs: 2
buffer[0] { type: "arrow"; color: "#16a34a"; name: "Buy"; arrow_code: Arrow.Up; };
buffer[1] { type: "arrow"; color: "#f59e0b"; name: "Star"; arrow_code: 171; }; // same as Arrow.Star
}
// 2. A named chart object
draw.Symbol("top", times[last], hi, Arrow.Star, "#f59e0b", 18.0);
// 3. Script code: names are int constants
int code = Arrow.Check;
Print("Arrow.Up=" + ToString(Arrow.Up)); // Arrow.Up=233| Function / Property | Description |
|---|---|
arrow_code (alias code) | Buffer key for type "arrow": a number 32..255 or Arrow.<Name>. No key = 233 (Arrow.Up). |
draw.Symbol(name, time, price, code, color, size) | One symbol at a point. code defaults to 233, size is the font size in px (default 14). See Drawing Objects. |
width (arrow buffers) | Symbol size: width 1 = 12 px, each extra width +3 px. |
Arrow.Up / Arrow.Down) are drawn as the chart's own solid arrow shapes. Every other code, and every code used by draw.Symbol, is drawn as the symbol shown in the tables below, in the buffer's or object's colour.Named Codes (Arrow.*)
Names are case-insensitive (Arrow.check works). A name that doesn't exist is a compile error that lists the valid names.
Arrow.Up233Arrow.Down234Arrow.Left231Arrow.Right232Arrow.UpLeft235Arrow.UpRight236Arrow.DownLeft237Arrow.DownRight238Arrow.ThickUp241Arrow.ThickDown242Arrow.ThickLeft239Arrow.ThickRight240Arrow.WideUp225Arrow.WideDown226Arrow.WideLeft223Arrow.WideRight224Arrow.ThumbUp67Arrow.ThumbDown68Arrow.PointUp71Arrow.PointDown72Arrow.PointLeft69Arrow.PointRight70Arrow.Circle108Arrow.Ring161Arrow.Bullet159Arrow.Square110Arrow.SquareHollow111Arrow.Diamond117Arrow.DiamondSmall119Arrow.Lozenge115Arrow.Star171Arrow.Check252Arrow.Cross251Arrow.BoxCheck254Arrow.BoxCross253Arrow.Flag79Arrow.Bell37Arrow.Hourglass54Arrow.Smile74Arrow.Frown76Arrow.Bomb77Arrow.Skull78Arrow.Sun82Arrow.Snowflake84All Codes 32–255
Every code in this range is valid. Highlighted cells have an Arrow.* name (hover for it). Code 32 is a space: it draws nothing. Emoji codes (📁, 🕐 …) take their look from the operating system's emoji font, so they may appear in full colour instead of the buffer colour.
Rules & Errors
A wrong code never silently turns into another shape: the script doesn't compile.
| Function / Property | Description |
|---|---|
arrow_code: 300; | Compile error: the code must be 32..255. |
arrow_code: 233.5; | Compile error: the code must be a whole number. |
arrow_code: Arrow.Triangle; | Compile error: unknown name; the message lists every Arrow.* name. |
int c = Arrow.Nope; | Compile error in script code too. |
type: Arrows; | Fine: display types are case-insensitive and accept singular / plural (arrow, arrows, Arrows). |
Style tab override | If a user enters an out-of-range code in the indicator settings, the script's own code is kept. |
On a bar where an arrow buffer holds 0.0 (or was never written), nothing is drawn. See Display → Empty Bars.
Example: Names & Numbers
Every 5th bar gets five markers above and five below the candle, named and numbered, including the edge codes 32 (draws nothing) and 255. It also uses Arrow.* in script code.
about {
author: "CoreXTrader";
version: "1.0.0";
about: "Arrow codes by name and number";
}
struct ArrowRow {
double up;
double down;
double thick_up;
double thick_down;
double star;
double check;
double cross;
double flag;
double edge_low;
double edge_high;
}
display {
outputs: 10
ArrowRow.up { type: "arrow"; color: "#16a34a"; name: "Arrow.Up"; arrow_code: Arrow.Up; };
ArrowRow.down { type: "arrow"; color: "#dc2626"; name: "Arrow.Down"; arrow_code: Arrow.Down; };
ArrowRow.thick_up { type: Arrows; color: "#15803d"; name: "Arrow.ThickUp"; arrow_code: Arrow.ThickUp; };
ArrowRow.thick_down { type: arrows; color: "#b91c1c"; name: "Arrow.ThickDown"; arrow_code: Arrow.ThickDown; };
ArrowRow.star { type: "arrow"; color: "#f59e0b"; name: "Arrow.Star"; arrow_code: Arrow.Star; };
ArrowRow.check { type: "arrow"; color: "#06b6d4"; name: "Arrow.Check"; code: Arrow.check; };
ArrowRow.cross { type: "arrow"; color: "#9333ea"; name: "Arrow.Cross"; arrow_code: Arrow.Cross; };
ArrowRow.flag { type: "arrow"; color: "#ea580c"; name: "Arrow.Flag"; arrow_code: Arrow.Flag; };
ArrowRow.edge_low { type: "arrow"; color: "#9ca3af"; name: "Code 32"; arrow_code: 32; };
ArrowRow.edge_high { type: "arrow"; color: "#9ca3af"; name: "Code 255"; arrow_code: 255; };
}
parameters {
int every = 5; // One marker set every N bars
double gap = 15; // Row spacing (points)
}
series double t7_up[];
series double t7_down[];
series double t7_thick_up[];
series double t7_thick_down[];
series double t7_star[];
series double t7_check[];
series double t7_cross[];
series double t7_flag[];
series double t7_edge_low[];
series double t7_edge_high[];
Init() {
int up = Arrow.Up;
int down = Arrow.Down;
Print("Arrow.Up=" + ToString(up) + " Arrow.Down=" + ToString(down) + " Arrow.Star=" + ToString(Arrow.Star));
}
calculate() {
double highs[] = high();
double lows[] = low();
int len = length(highs);
t7_up[] = create_array(len);
t7_down[] = create_array(len);
t7_thick_up[] = create_array(len);
t7_thick_down[] = create_array(len);
t7_star[] = create_array(len);
t7_check[] = create_array(len);
t7_cross[] = create_array(len);
t7_flag[] = create_array(len);
t7_edge_low[] = create_array(len);
t7_edge_high[] = create_array(len);
double step = gap * Symbol.Point();
for (int i = Chart.resume_index; i < len; i = i + 1) {
if (i % every == 0) {
t7_down[i] = highs[i] + step;
t7_thick_down[i] = highs[i] + 2.0 * step;
t7_star[i] = highs[i] + 3.0 * step;
t7_cross[i] = highs[i] + 4.0 * step;
t7_edge_high[i] = highs[i] + 5.0 * step;
t7_up[i] = lows[i] - step;
t7_thick_up[i] = lows[i] - 2.0 * step;
t7_check[i] = lows[i] - 3.0 * step;
t7_flag[i] = lows[i] - 4.0 * step;
t7_edge_low[i] = lows[i] - 5.0 * step;
} else {
t7_up[i] = 0.0; t7_down[i] = 0.0;
t7_thick_up[i] = 0.0; t7_thick_down[i] = 0.0;
t7_star[i] = 0.0; t7_check[i] = 0.0;
t7_cross[i] = 0.0; t7_flag[i] = 0.0;
t7_edge_low[i] = 0.0; t7_edge_high[i] = 0.0;
}
}
return ArrowRow {
up: t7_up, down: t7_down,
thick_up: t7_thick_up, thick_down: t7_thick_down,
star: t7_star, check: t7_check, cross: t7_cross, flag: t7_flag,
edge_low: t7_edge_low, edge_high: t7_edge_high
};
}Example: Symbols & Text
Every 6th bar gets a column of symbols: ⇧ 👍 ★ ✔ ⚐ ① above the bar and ⇩ 👎 ◆ ✗ ● ☺ below it. Between the columns, text buffers write "BUY" under green bars and "SELL" over red ones. Width 2 rows are drawn larger.
about {
author: "CoreXTrader";
version: "1.0.0";
about: "Text labels and arrow symbols";
}
struct Marks {
double thick_up;
double thumb_up;
double star;
double check;
double flag;
double one;
double thick_down;
double thumb_down;
double diamond;
double cross;
double circle;
double smile;
double buy_text;
double sell_text;
}
display {
outputs: 14
Marks.thick_up { type: "arrow"; color: "#16a34a"; name: "ThickUp"; arrow_code: Arrow.ThickUp; };
Marks.thumb_up { type: "arrow"; color: "#16a34a"; name: "ThumbUp"; arrow_code: Arrow.ThumbUp; };
Marks.star { type: "arrow"; color: "#f59e0b"; name: "Star"; arrow_code: Arrow.Star; width: 2; };
Marks.check { type: "arrow"; color: "#22c55e"; name: "Check"; arrow_code: Arrow.Check; };
Marks.flag { type: "arrow"; color: "#ea580c"; name: "Flag"; arrow_code: Arrow.Flag; };
Marks.one { type: "arrow"; color: "#60a5fa"; name: "Code 129"; arrow_code: 129; };
Marks.thick_down { type: "arrow"; color: "#dc2626"; name: "ThickDown"; arrow_code: Arrow.ThickDown; };
Marks.thumb_down { type: "arrow"; color: "#dc2626"; name: "ThumbDown"; arrow_code: Arrow.ThumbDown; };
Marks.diamond { type: "arrow"; color: "#a855f7"; name: "Diamond"; arrow_code: Arrow.Diamond; };
Marks.cross { type: "arrow"; color: "#ef4444"; name: "Cross"; arrow_code: Arrow.Cross; };
Marks.circle { type: "arrow"; color: "#94a3b8"; name: "Circle"; arrow_code: Arrow.Circle; width: 2; };
Marks.smile { type: "arrow"; color: "#facc15"; name: "Smile"; arrow_code: Arrow.Smile; };
Marks.buy_text { type: "text"; color: "#16a34a"; name: "Buy"; text: "BUY"; };
Marks.sell_text { type: "text"; color: "#dc2626"; name: "Sell"; text: "SELL"; };
}
parameters {
int every = 6; // Marker column every N bars
double gap = 20; // Row spacing (points)
}
series double t9_a[];
series double t9_b[];
series double t9_c[];
series double t9_d[];
series double t9_e[];
series double t9_f[];
series double t9_g[];
series double t9_h[];
series double t9_dia[];
series double t9_j[];
series double t9_k[];
series double t9_l[];
series double t9_buy[];
series double t9_sell[];
calculate() {
double opens[] = open();
double highs[] = high();
double lows[] = low();
double closes[] = close();
int len = length(closes);
t9_a[] = create_array(len);
t9_b[] = create_array(len);
t9_c[] = create_array(len);
t9_d[] = create_array(len);
t9_e[] = create_array(len);
t9_f[] = create_array(len);
t9_g[] = create_array(len);
t9_h[] = create_array(len);
t9_dia[] = create_array(len);
t9_j[] = create_array(len);
t9_k[] = create_array(len);
t9_l[] = create_array(len);
t9_buy[] = create_array(len);
t9_sell[] = create_array(len);
double step = gap * Symbol.Point();
for (int i = Chart.resume_index; i < len; i = i + 1) {
t9_a[i] = 0.0; t9_b[i] = 0.0; t9_c[i] = 0.0; t9_d[i] = 0.0; t9_e[i] = 0.0; t9_f[i] = 0.0;
t9_g[i] = 0.0; t9_h[i] = 0.0; t9_dia[i] = 0.0; t9_j[i] = 0.0; t9_k[i] = 0.0; t9_l[i] = 0.0;
t9_buy[i] = 0.0; t9_sell[i] = 0.0;
if (i % every == 0) {
t9_a[i] = highs[i] + 1.0 * step;
t9_b[i] = highs[i] + 2.0 * step;
t9_c[i] = highs[i] + 3.0 * step;
t9_d[i] = highs[i] + 4.0 * step;
t9_e[i] = highs[i] + 5.0 * step;
t9_f[i] = highs[i] + 6.0 * step;
t9_g[i] = lows[i] - 1.0 * step;
t9_h[i] = lows[i] - 2.0 * step;
t9_dia[i] = lows[i] - 3.0 * step;
t9_j[i] = lows[i] - 4.0 * step;
t9_k[i] = lows[i] - 5.0 * step;
t9_l[i] = lows[i] - 6.0 * step;
} else if (i % every == 3) {
if (closes[i] > opens[i]) {
t9_buy[i] = lows[i] - step;
} else {
t9_sell[i] = highs[i] + step;
}
}
}
return Marks {
thick_up: t9_a, thumb_up: t9_b, star: t9_c, check: t9_d, flag: t9_e, one: t9_f,
thick_down: t9_g, thumb_down: t9_h, diamond: t9_dia, cross: t9_j, circle: t9_k, smile: t9_l,
buy_text: t9_buy, sell_text: t9_sell
};
}