Docs / Arrow Codes

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.

Three places a code goesTDSL
// 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 / PropertyDescription
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.
Note
In an arrow buffer, 233 and 234 (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.

Arrows
↑Arrow.Up233
↓Arrow.Down234
←Arrow.Left231
→Arrow.Right232
↖Arrow.UpLeft235
↗Arrow.UpRight236
↙Arrow.DownLeft237
↘Arrow.DownRight238
Thick & wide arrows
⇧Arrow.ThickUp241
⇩Arrow.ThickDown242
⇦Arrow.ThickLeft239
⇨Arrow.ThickRight240
⬆Arrow.WideUp225
⬇Arrow.WideDown226
⬅Arrow.WideLeft223
➡Arrow.WideRight224
Hands
👍Arrow.ThumbUp67
👎Arrow.ThumbDown68
☝Arrow.PointUp71
☟Arrow.PointDown72
☜Arrow.PointLeft69
☞Arrow.PointRight70
Shapes
●Arrow.Circle108
○Arrow.Ring161
•Arrow.Bullet159
■Arrow.Square110
□Arrow.SquareHollow111
◆Arrow.Diamond117
⬥Arrow.DiamondSmall119
⬧Arrow.Lozenge115
★Arrow.Star171
Marks
✔Arrow.Check252
✗Arrow.Cross251
☑Arrow.BoxCheck254
☒Arrow.BoxCross253
⚐Arrow.Flag79
Pictures
🔔Arrow.Bell37
⌛Arrow.Hourglass54
☺Arrow.Smile74
☹Arrow.Frown76
💣Arrow.Bomb77
☠Arrow.Skull78
☼Arrow.Sun82
❄Arrow.Snowflake84

All 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.

␠32
✏33
✂34
✁35
👓36
🔔37
📖38
🕯39
☎40
✆41
✉42
✉43
📪44
📫45
📬46
📭47
📁48
📂49
📄50
📄51
📄52
🗄53
⌛54
⌨55
🖱56
🖲57
🖥58
🖴59
💾60
💾61
✇62
✍63
✍64
✌65
👌66
👍67
👎68
☜69
☞70
☝71
☟72
✋73
☺74
😐75
☹76
💣77
☠78
⚐79
⚑80
✈81
☼82
💧83
❄84
✝85
✞86
✟87
✠88
✡89
☪90
☯91
ॐ92
☸93
♈94
♉95
♊96
♋97
♌98
♍99
♎100
♏101
♐102
♑103
♒104
♓105
&106
&107
●108
❍109
■110
□111
◻112
❑113
❒114
⬧115
⧫116
◆117
❖118
⬥119
⌧120
⍓121
⌘122
❀123
✿124
❝125
❞126
▯127
⓪128
①129
②130
③131
④132
⑤133
⑥134
⑦135
⑧136
⑨137
⑩138
⓿139
❶140
❷141
❸142
❹143
❺144
❻145
❼146
❽147
❾148
❿149
❧150
☙151
☙152
❧153
❦154
❦155
❧156
☙157
·158
•159
▪160
○161
⭕162
◯163
◉164
◎165
◌166
▪167
◻168
◇169
✦170
★171
✶172
✴173
✹174
✵175
✛176
⌖177
⟡178
⌑179
❓180
✪181
✰182
🕐183
🕑184
🕒185
🕓186
🕔187
🕕188
🕖189
🕗190
🕘191
🕙192
🕚193
🕛194
⤶195
⤷196
⤴197
⤵198
↰199
↱200
↲201
↳202
❦203
❦204
❧205
❧206
☙207
☙208
❦209
❦210
❧211
❧212
⌫213
⌦214
◀215
▶216
▲217
▼218
◂219
▸220
▴221
▾222
⬅223
➡224
⬆225
⬇226
⬉227
⬈228
⬋229
⬊230
←231
→232
↑233
↓234
↖235
↗236
↙237
↘238
⇦239
⇨240
⇧241
⇩242
⬄243
⇳244
⬀245
⬁246
⬃247
⬂248
▭249
▯250
✗251
✔252
☒253
☑254
⊞255

Rules & Errors

A wrong code never silently turns into another shape: the script doesn't compile.

Function / PropertyDescription
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 overrideIf 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.

ArrowCodes.tdsl — Arrow.* names, plain numbers, names in codeTDSL
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.

SymbolsAndText.tdsl — arrow symbols + text buffersTDSL
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
    };
}