NexusFi: Find Your Edge


Home Menu

 





Keltner Channel: Multicharts vs. Esignal


Discussion in MultiCharts

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




 
Search this Thread

Keltner Channel: Multicharts vs. Esignal

  #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?
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
18 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 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: 147

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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts