Indicator · Pine Script v4 · Own pane

KuChart DayLight Basic Currencies

by Vertexstack-Code· code credited to willcomeo022

This indicator calculates and plots the relative performance of eight major currencies (USD, EUR, GBP, CHF, JPY, AUD, CAD, and NZD) in a separate pane.

View on GitHub

GitHub stars4on the repository
Pine versionv4older, still runs
Lines of code132
Settings20inputs
LicenceNone statedfile: MPL-2.0
Last update6 years ago26 Oct 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

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

KuChartDayLight_BasicCurrencies.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © willcomeo022

//@version=4
study("KuChartDayLight_BasicCurrencies")

RefreshTime = input(title="RefreshTime", type=input.integer, defval=5)
MaxBars = input(title="MaxBars", type=input.integer, defval=1000)
MAPeriod = input(title="MAPeriod", type=input.integer, defval=1)
MAPrice = input(title="MAPrice", type=input.source, defval=close)
MAMethod = input(title="MAMethod", type=input.integer, defval=0)
Start_Time = input(title="Start_Time", type=input.string, defval="2011.03.14 00:00")
UseLongTermMode = input(title="UseLongTermMode", type=input.bool, defval=false)
TimeOffset = input(title="TimeOffset", type=input.integer, defval=0)
DaySpan = input(title="DaySpan", type=input.integer, defval=1)
SelectedLineWidth = input(title="SelectedLineWidth", type=input.integer, defval=1)
NonSelectedLineWidth = input(title="NonSelectedLineWidth", type=input.integer, defval=1)
UseAutoDetect = input(title="UseAutoDetect", type=input.bool, defval=true)

UseUSD = true
UseEUR = true
UseGBP = true
UseCHF = true
UseJPY = true
UseAUD = true
UseCAD = true
UseNZD = true

ShowUSD = input(title="ShowUSD", type=input.bool, defval=true)
ShowEUR = input(title="ShowEUR", type=input.bool, defval=true)
ShowGBP = input(title="ShowGBP", type=input.bool, defval=true)
ShowCHF = input(title="ShowCHF", type=input.bool, defval=true)
ShowJPY = input(title="ShowJPY", type=input.bool, defval=true)
ShowAUD = input(title="ShowAUD", type=input.bool, defval=true)
ShowCAD = input(title="ShowCAD", type=input.bool, defval=true)
ShowNZD = input(title="ShowNZD", type=input.bool, defval=true)

Color_USD = color.orange
Color_EUR = color.red
Color_GBP = color.lime
Color_CHF = color.white
Color_JPY = color.green
Color_AUD = color.blue
Color_CAD = color.yellow
Color_NZD = color.teal

sEURUSD = "FX:EURUSD"
sUSDJPY = "FX:USDJPY"
sUSDCHF = "FX:USDCHF"
sGBPUSD = "FX:GBPUSD"
sAUDUSD = "FX:AUDUSD"
sUSDCAD = "FX:USDCAD"
sNZDUSD = "FX:NZDUSD"

EURUSD = security(sEURUSD, timeframe.period, MAPrice)
USDJPY = security(sUSDJPY, timeframe.period, MAPrice)
USDCHF = security(sUSDCHF, timeframe.period, MAPrice)
GBPUSD = security(sGBPUSD, timeframe.period, MAPrice)
AUDUSD = security(sAUDUSD, timeframe.period, MAPrice)
USDCAD = security(sUSDCAD, timeframe.period, MAPrice)
NZDUSD = security(sNZDUSD, timeframe.period, MAPrice)

t = time("1440", session.regular)
Is_NewDay = na(t[1]) and not na(t) or t[1] < t

var float First_EURUSD = na
var float First_USDJPY = na
var float First_USDCHF = na
var float First_GBPUSD = na
var float First_AUDUSD = na
var float First_USDCAD = na
var float First_NZDUSD = na

if Is_NewDay
    First_EURUSD := EURUSD
    First_USDJPY := USDJPY
    First_USDCHF := USDCHF
    First_GBPUSD := GBPUSD
    First_AUDUSD := AUDUSD
    First_USDCAD := USDCAD
    First_NZDUSD := NZDUSD

vEURUSD = log(EURUSD / First_EURUSD) * 10000
vUSDJPY = log(USDJPY / First_USDJPY) * 10000
vUSDCHF = log(USDCHF / First_USDCHF) * 10000
vGBPUSD = log(GBPUSD / First_GBPUSD) * 10000
vAUDUSD = log(AUDUSD / First_AUDUSD) * 10000
vUSDCAD = log(USDCAD / First_USDCAD) * 10000
vNZDUSD = log(NZDUSD / First_NZDUSD) * 10000

if UseEUR == false
    vEURUSD := 0
if UseJPY == false
    vUSDJPY := 0
if UseCHF == false
    vUSDCHF := 0
if UseGBP == false
    vGBPUSD := 0
if UseAUD == false
    vAUDUSD := 0
if UseCAD == false
    vUSDCAD := 0
if UseNZD == false
    vNZDUSD := 0
if UseUSD == false
    vEURUSD := 0
    vUSDJPY := 0
    vUSDCHF := 0
    vGBPUSD := 0
    vAUDUSD := 0
    vUSDCAD := 0
    vNZDUSD := 0

a = (vEURUSD + vGBPUSD + vAUDUSD + vNZDUSD - vUSDJPY - vUSDCHF - vUSDCAD) / 7

EURAV= vEURUSD - a
USDAV= - a
JPYAV= -vUSDJPY - a
CHFAV= -vUSDCHF - a
GBPAV= vGBPUSD - a      
AUDAV= vAUDUSD - a
CADAV= -vUSDCAD - a
NZDAV= vNZDUSD - a

plot(USDAV, title="USD", color = Color_USD)
plot(EURAV, title="EUR", color = Color_EUR)
plot(JPYAV, title="JPY", color = Color_JPY)
plot(CHFAV, title="CHF", color = Color_CHF)
plot(GBPAV, title="GBP", color = Color_GBP)
plot(AUDAV, title="AUD", color = Color_AUD)
plot(CADAV, title="CAD", color = Color_CAD)
plot(NZDAV, title="NZD", color = Color_NZD)

Overview

KuChart DayLight Basic Currencies fetches price data from major Forex currency pairs and calculates logarithmic percentage changes relative to the start of each daily session. Users can identify individual currency strength and weakness across the Forex market. Settings allow toggling the display for each currency, setting line widths, and adjusting moving average smoothing parameters.

Details

Published by

Vertexstack-Code on GitHub

Code credit

willcomeo022, as written in the script's header

Type

Indicator, Pine Script v4

Draws

Separate pane below the chart

Category

Oscillators & momentum, Screeners & dashboards

Markets

Forex

Timeframes

M15-H1, H4 and above

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
RefreshTimeint5RefreshTime
MaxBarsint1000MaxBars
MAPeriodint1MAPeriod
MAPricesourcecloseMAPrice
MAMethodint0MAMethod
Start_Timestring2011.03.14 00:00Start_Time
UseLongTermModeboolfalseUseLongTermMode
TimeOffsetint0TimeOffset
DaySpanint1DaySpan
SelectedLineWidthint1SelectedLineWidth
NonSelectedLineWidthint1NonSelectedLineWidth
UseAutoDetectbooltrueUseAutoDetect
Show all 20 settings
SettingTypeDefaultVariable
ShowUSDbooltrueShowUSD
ShowEURbooltrueShowEUR
ShowGBPbooltrueShowGBP
ShowCHFbooltrueShowCHF
ShowJPYbooltrueShowJPY
ShowAUDbooltrueShowAUD
ShowCADbooltrueShowCAD
ShowNZDbooltrueShowNZD
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

This indicator scans a pasted list of symbols for RSI directional momentum and shows matching long and short signals in a table in a separate pane. The user chooses continuous break, continuous retracement, flip break, flip retracement, divergence, or hidden d

Indicator v6 Oscillators & momentumDivergence
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - RSI Directional Momentum Scanner
261 stars

This indicator plots the RSI oscillator on the main chart and displays its value distribution in a table positioned at the top right. The script calculates the relative strength index using the input source and length, then plots horizontal lines at 0, 50, and

Indicator v4 Oscillators & momentumScreeners & dashboards
Updated 4 years ago · None stated GitHub repository of Tables-003 Oscillator Distribution

Market Speedometer

by TradersPost
218 stars

Market Speedometer plots a 0-100 market speed reading in a separate pane. It measures movement by bar-to-bar change, true range, or a short average of recent bars, then ranks that movement against ATR and a percentile lookback. An EMA smooths the reading, and

Indicator v6 Volatility & bandsOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Market Speedometer

KamaFama

by Mastaaa1987
141 stars

KamaFama is an indicator that translates a Freqtrade trading strategy into Pine Script for visualization. It combines Kaufman Adaptive Moving Average (KAMA), MAMA/FAMA calculations derived via Hilbert Transform, Williams %R, and correlation trend filters to ev

Indicator v6 Moving averagesOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of KamaFama
114 stars

Calculates normalized reversal metrics across up to ten Forex currency pairs using user-selected moving average methods, including HarmonicMA, EMA, SMA, or WMA. The indicator identifies overbought, oversold, and mean-crossing conditions using a configurable th

Indicator v4 Screeners & dashboardsMean reversion
Updated 1 year ago · None stated GitHub repository of Multi-Pair Trend Reversal Widget

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers