Indicator · Pine Script v4 · Own pane

|AG| Project

by Anderson-ALGO· code credited to Anderson_Guilcapi

|AG| Project is a Pine Script v4 indicator that draws four mini charts in a separate pane.

View on GitHub

GitHub stars9on the repository
Pine versionv4older, still runs
Lines of code93
Settings6inputs
LicenceNone statedfile: MPL-2.0
Last update5 years ago30 Nov 2020

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

93 lines of Pine Script v4 from Pine/PineScript/MiniChart/Project.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

Project.pine
// This source code is subject to the terms of the Mozilla Public License 2.i at https://mozilla.org/MPL/2.i/
// © Anderson_Guilcapi

//@version=4
study("|AG| Project")

b_wi        = input(title = "Bar Width", defval=6)
_prc1       = 10 //lenght not recomendable to change
_ma_v       = input(title = "MA VALUE", defval=20)
xp_1 = time + round(change(time) * -(30))
xp_2 = time + round(change(time) * -(20))
xp_3 = time + round(change(time) * -(10))
xp_4 = time + round(change(time) * -(0 ))
string tckr_1 = input("EURUSD", title="Ticker 1", type=input.symbol)
string tckr_2 = input("XAUUSD", title="Ticker 2", type=input.symbol)
string tckr_3 = input("XAUEUR", title="Ticker 3", type=input.symbol)
string tckr_4 = input("EURCAD", title="Ticker 4", type=input.symbol)

[open_1, high_1, low_1, close_1] = security(tckr_1, timeframe.period, [open, high, low, close]) 
[open_2, high_2, low_2, close_2] = security(tckr_2, timeframe.period, [open, high, low, close]) 
[open_3, high_3, low_3, close_3] = security(tckr_3, timeframe.period, [open, high, low, close]) 
[open_4, high_4, low_4, close_4] = security(tckr_4, timeframe.period, [open, high, low, close]) 

get_percetage(v1_, v2_, v3_, v4_)=>
    float _o = v1_
    float _h = v2_
    float _l = v3_
    float _c = v4_
    [_o, _h, _l, _c]

[po1_, ph1_, pl1_, pc1_]  = get_percetage(open_1, high_1, low_1, close_1)
[po2_, ph2_, pl2_, pc2_]  = get_percetage(open_2, high_2, low_2, close_2)
[po3_, ph3_, pl3_, pc3_]  = get_percetage(open_3, high_3, low_3, close_3)
[po4_, ph4_, pl4_, pc4_]  = get_percetage(open_4, high_4, low_4, close_4)

rescale(_src, _oldMin, _oldMax, _newMin, _newMax) =>
    _newMin + (_newMax - _newMin) * (_src - _oldMin) / max(_oldMax - _oldMin, 10e-10)

index(s) =>
    min(s[6], min(s[5], min(s[4], s[2], min(s[1], s))))

scale(_o_, _h_, _l_, _c_)=>
    float _o =  rescale ( stoch(_o_, _h_ , _l_ , 14), 0 , 1, 10, 20)
    float _h =  rescale ( stoch(_h_, _h_ , _l_ , 14), 0 , 1, 10, 20)
    float _l =  rescale ( stoch(_l_, _h_ , _l_ , 14), 0 , 1, 10, 20)
    float _c =  rescale ( stoch(_c_, _h_ , _l_ , 14), 0 , 1, 10, 20)
    [_o, _h, _l, _c]

[po1, ph1, pl1, pc1] = scale(po1_, ph1_, pl1_, pc1_)
[po2, ph2, pl2, pc2] = scale(po2_, ph2_, pl2_, pc2_)
[po3, ph3, pl3, pc3] = scale(po3_, ph3_, pl3_, pc3_)
[po4, ph4, pl4, pc4] = scale(po4_, ph4_, pl4_, pc4_)

labelpos = index(pl1)

plot(ema(pc1, _ma_v), offset=-30, show_last=6)
plot(ema(pc2, _ma_v), offset=-20, show_last=6)
plot(ema(pc3, _ma_v), offset=-10, show_last=6)
plot(ema(pc4, _ma_v), offset=-0 , show_last=6)

f_draw_line(_x, _o, _h, _l, _c, _ticker, _ll, _label_pos, _xx)=>
    _color = _c > _o ? color.black : color.purple
    var line _body = na
    var line _wick = na
    line.delete(_body[1])
    line.delete(_wick[1])
    _body := line.new( 
             x1=_x, y1=_o, 
             x2=_x, y2=_c, 
             xloc=xloc.bar_time, extend=extend.none,
             color=_color, style=line.style_solid, width=b_wi
             )
    _wick := line.new( 
             x1=_x, y1=_h, 
             x2=_x, y2=_l, 
             xloc=xloc.bar_time, extend=extend.none,
             color=_color, style=line.style_solid, width=1
             )
    if true
        var label _la = na
        label.delete(_la)
        _la := label.new(
             x=_x[2], y=labelpos,
             text= _ticker + "\n" + tostring(_xx) + " [ " + tostring(((_ll-_ll[1])/_ll[1]*100) ,  "#.###") + " % ]",
             xloc=xloc.bar_time, yloc=yloc.price,
             color=color.red, style=label.style_labelup, textcolor=color.white, size=size.normal
             )

for _i = 5 to 0
    f_draw_line(xp_1[_i], po1[_i], ph1[_i], pl1[_i], pc1[_i], tckr_1, close_1, labelpos, close_1)
    f_draw_line(xp_2[_i], po2[_i], ph2[_i], pl2[_i], pc2[_i], tckr_2, close_2, labelpos, close_2)
    f_draw_line(xp_3[_i], po3[_i], ph3[_i], pl3[_i], pc3[_i], tckr_3, close_3, labelpos, close_3)
    f_draw_line(xp_4[_i], po4[_i], ph4[_i], pl4[_i], pc4[_i], tckr_4, close_4, labelpos, close_4)

Overview

|AG| Project requests open, high, low, and close for user-selected symbols, rescales those values with a stochastic calculation, and plots an exponential moving average of each scaled close. Line drawings form candle bodies and wicks, and labels show each ticker with a percentage change. Bar width, moving-average length, and the four symbols are the main settings. It is not a trading strategy and has no entry or exit rules.

Details

Published by

Anderson-ALGO on GitHub

Code credit

Anderson_Guilcapi, as written in the script's header

Type

Indicator, Pine Script v4

Draws

Separate pane below the chart

Markets

Forex, Gold

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Bar Widthint6b_wi
MA VALUEint20_ma_v
Ticker 1symbolEURUSDtckr_1
Ticker 2symbolXAUUSDtckr_2
Ticker 3symbolXAUEURtckr_3
Ticker 4symbolEURCADtckr_4
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

The Candle Pressure Index measures buying versus selling pressure from candle geometry and relative volume. Each bar combines close location, body ratio, and volume rank into a raw pressure value. An exponential moving average of that pressure forms the CPI os

Indicator v6 Oscillators & momentumVolume
Updated 3 days ago · MIT GitHub repository of Candle Pressure Index [WavesUnchained]
575 stars

The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Displacement Candles Indicator

Confluence Suite

by TamaraKGreen
46 stars

The Confluence Suite indicator draws multiple trading signals and tools directly on the price chart. It generates entry and exit signals based on selected modes and filters, with an AI signal classifier rating quality from 1-4. Additional features include smar

Indicator v5 TrendSMC / ICT / price action
Updated 8 weeks ago · None stated GitHub repository of Confluence Suite
32 stars

Ghost Channels fits dynamic parallel trend channels over a configurable lookback window using linear regression or pivot swing methods. It layers confirmation signals onto the channel geometry, detecting candlestick pattern reactions at the rails, volume-confi

Indicator v6 TrendBreakout
Updated 4 days ago · MIT GitHub repository of Ghost Channels [mph1nance]

Zen OOH OOL v3

by Zen-Tim
29 stars

This indicator identifies whether the opening bar of a new trading day opens at its high (Open = High) or low (Open = Low) within a customizable tick tolerance. It marks matching sessions directly on the price chart using directional arrows, text labels, and t

Indicator v5 Sessions & timeCandlestick patterns
Updated 2 weeks ago · MIT GitHub repository of Zen OOH OOL v3

Fractal Reclaim Strength

by selimgrsoy0-commits
12 stars

The indicator tracks four-bar fractal sweep and reclaim setups on chart timeframes of 15 minutes and above. It calculates Reclaim Strength based on where C2 closes relative to C1's range and plots level lines for the swept C1 extreme and C2 extreme. An on-scre

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Fractal Reclaim Strength

More Screeners & dashboards scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers