NexusFi: Find Your Edge


Home Menu

 





Keltner Channel: Multicharts vs. Esignal


Discussion in MultiCharts

Updated
    1. trending_up 4,149 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
kottgolf
Montreal
 
Posts: 8 since Feb 2012
Thanks Given: 2
Thanks Received: 7

Hi, I am having problems with Keltner Channels. I am using the same formula (confirmed by a esignal programmer and multicharts programmer). However I am getting different values.
The Keltner Channel is pretty basic. I believe Esignal is plotting the right Keltner Channel and Multicharts is not. Has anyone had this problem? And yes I am using the same parameters.

Esignal Code:
/*********************************
Provided By:
eSignal (Copyright c eSignal), a division of Interactive Data
Corporation. 2009. All rights reserved. This sample eSignal
Formula Script (EFS) is for educational purposes only and may be
modified and saved under a new file name. eSignal is not responsible
for the functionality once modified. eSignal reserves the right
to modify and overwrite this EFS file with each new release.

Description:
Keltner ATR Band

Version: 1.0 10/29/2009

Formula Parameters: Default:
Length 20
ATRMult 3.75

Notes:

**********************************/
var fpArray = new Array();
var bInit = false;

function preMain(){
setPriceStudy(true);
setShowCursorLabel(true);
setShowTitleParameters(false);
setStudyTitle("Keltner ATR Band");
setCursorLabelName("Up Band", 0);
setPlotType(PLOTTYPE_LINE, 0);
setDefaultBarFgColor(Color.red, 0);
setCursorLabelName("Dn Band", 1);
setPlotType(PLOTTYPE_LINE, 1);
setDefaultBarFgColor(Color.red, 1);
var x = 0;
fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
with(fpArray[x++]) {
setLowerLimit(1);
setDefault(20);
}
fpArray[x] = new FunctionParameter("ATRMult", FunctionParameter.NUMBER);
with(fpArray[x++]) {
setLowerLimit(1);
setDefault(3.75);
}
}

var xKUp = null;
var xKDn = null;

function main(Length, ATRMult) {
var nBarState = getBarState();
var nKU = 0;
var nKL = 0;
if (nBarState == BARSTATE_ALLBARS) {
if(Length == null) Length = 20;
if(ATRMult == null) ATRMult = 3.75;
}
if (bInit == false) {
xKUp = efsInternal("Calc_KeltnerBand", Length, ATRMult);
xKDn = getSeries(xKUp, 1);
bInit = true;
}
nKU = xKUp.getValue(0);
nKL = xKDn.getValue(0);
if (nKU == null || nKL == null) return;
return new Array(nKU, nKL);
}

var bSecondInit = false;
var xMA = null;
var xATR = null;

function Calc_KeltnerBand(Length, ATRMult) {
var nResUp = 0;
var nResDn = 0;
var nMA = 0;
var nATR = 0;
if (bSecondInit == false) {
xMA = sma(Length);
xATR = atr(Length);
bSecondInit = true;
}
nMA = xMA.getValue(0);
nATR = xATR.getValue(0);
if (nMA == null || nATR == null) return;
nResUp = nMA + ATRMult * nATR;
nResDn = nMA - ATRMult * nATR;
return new Array(nResUp, nResDn);
}

MULTICHARTS:
inputs: Price( Close ), Length( 20 ), NumATRs( 3.75 ), Displace( 0 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ) ;

var0 = AverageFC( Price, Length ) ;
var1 = NumATRs * AvgTrueRange( Length ) ;
var3 = var0 + var1 ;
var2 = var0 - var1 ;

condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
begin
Plot1[Displace]( var3, "UpperBand" ) ;
Plot2[Displace]( var2, "LowerBand" ) ;
Plot3[Displace]( var0, "MidLine" ) ;



Thanks!


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
The Pivot Point 113.6³ — Navigating the Prediction of …
26 thanks
Sober Journey With S&P
17 thanks
The Confluence Meter: A Multi-Layered Signal Framework B …
11 thanks
NT8 color choices
10 thanks
Volume Indicators
7 thanks
  #2 (permalink)
 
furytrader's Avatar
 furytrader 
Lake Forest, IL USA
 
Experience: Intermediate
Platform: MultiCharts + CTS T4
Broker: Advantage Futures, IQFeed.net
Trading: YM, ES, EU, US, S
Posts: 153 since Jun 2011
Thanks Given: 109
Thanks Received: 151

One solution (albeit a tedious one) would be to import a section of your price data into excel and calculate the indicator manually using Excel functions. This should tell you which one is right.


Reply With Quote
  #3 (permalink)
kottgolf
Montreal
 
Posts: 8 since Feb 2012
Thanks Given: 2
Thanks Received: 7


Thanks but I've had a programmer do this for the esignal formula and this one is correct.
It's Multicharts the problem I believe.
It was a long shot to ask if anybody else has noticed this on Multicharts.


Reply With Quote
  #4 (permalink)
kottgolf
Montreal
 
Posts: 8 since Feb 2012
Thanks Given: 2
Thanks Received: 7

I figured it out.
TS and Multicharts do not use the proper way to calculated Keltner Channel.
They do not use Wilder's way of calculating AverageTrueRange.

To adjust for this, create AvgTrueRangeWilder as a function:


inputs: Length( numericsimple ) ;

AvgTrueRangeWilder = XAverageOrig( TrueRange, Length ) ;


Reply With Quote
Thanked by:




Last Updated on May 7, 2012


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts