Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: Dinapoli Perferred Stochastic
Author/Uploader: TohMz - (email hidden)
Date/Time added: 2008-06-02 11:25:15
Origin:
Keywords: stochastic
Level: basic
Flags: indicator

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:

Based on "Joe DiNapoli - The Practical Application of Fibonacci Analysis to Investment Markets" - APPENDIX E
Formula description AND

Derived from given eSignal formula suggested by LaNard

Formula:

/***********************************************************************************************************
  Dinapoli Perferred Stochastic
  Based on "Joe DiNapoli - The Practical Application of Fibonacci Analysis to
Investment Markets"
  APPENDIX E

  Derived from given eSignal formula suggested by LaNard on 2008-05-31 in the
comment:
  refer "DiNapolis 3x Displaced Moving Averages" at
  http://www.amibroker.com/library/detail.php?id=1090

  Script Created by TohMz
  
***********************************************************************************************************/
SetChartOptions(0,0,chartGrid20|chartGrid50|chartGrid80);

function StochRaw(nLength, nSmoothing)
{
  Hh = HHV(High, nLength);
  Ll = LLV(Low, nLength);
  Hh = HHV(High, nLength);
  Ll = LLV(Low, nLength);
  return ((Close - ll) / (hh - ll)) * 100; 
}

function PreferStochK(nLength, nSmoothing) 
{
  percentK =StochRaw(nLength, nSmoothing);

  MAVt[0]=0;
  for(i=1; i<BarCount; i++)
     MAVt[i] = MAVt[i-1] + (percentK[i] - MAVt[i-1]) / nSmoothing;
  return MAVt;
}

function PreferStochD(nLength, nSmoothing, nSmoothings) 
{
  percentK = PreferStochK(nLength, nSmoothing);
  MAVt[0] = 0;
  for(i=1; i<BarCount; i++)
         MAVt[i] = MAVt[i-1] + (percentK[i] - MAVt[i-1]) / nSmoothings;
  return MAVt;

}

Period = Param("Period", 8, 3, 100);
Ksmooth = Param("%K Smooth", 3, 3, 100);
Dsmooth = Param("%D Smooth", 3, 3, 100);
Upper = Param("%Upper Level", 75, 0, 100);
Lower = Param("%Lower Level", 25, 0, 100);


Plot( PreferStochK(Period, Ksmooth),    "percentK", colorBlue);
Plot( PreferStochD(Period, Ksmooth, Dsmooth), "percentD", colorRed);
Plot(Upper, "", colorBlack, styleDashed);
Plot(Lower, "", colorBlack, styleDashed);

Comments:

LaNard

2008-06-02 13:43:47
THANK VERY VERY MUCH......Keep up the good work
LaNard

2008-06-04 16:57:54
Hi again,

This formula is derived off of Joe DiNapoli's work whom Mr. Fibmaster (Neal Hughes) gives credit. I've been working with his Fibonacci methods which led me to Mr. DiNapoli's indicators. Can you assist me with this formula. Thank you again for your help towards profitable trading.

//{{EFSWizard_Description
////}}EFSWizard_Description 7532


//{{EFSWizard_Declarations
setStudyMin(5);
setStudyMax(95);
addBand(40, PS_SOLID, 1, Color.grey, "Lower");
addBand(60, PS_SOLID, 1, Color.grey, "Upper");

var vRSI14 = new RSIStudy(14, "Close");
var vEMA3_of_vRSI14 = new MAStudy(3, 0, vRSI14, RSIStudy.RSI, MAStudy.EXPONENTIAL);
var vEMA3_of_vEMA3_of_vRSI14 = new MAStudy(3, 0, vEMA3_of_vRSI14, MAStudy.MA, MAStudy.EXPONENTIAL);
var vEMA3_of_vEMA3_of_vEMA3_of_vRSI14 = new MAStudy(3, 0, vEMA3_of_vEMA3_of_vRSI14, MAStudy.MA, MAStudy.EXPONENTIAL);
var vSMA5_of_vEMA3_of_vEMA3_of_vEMA3_of_vRSI14 = new MAStudy(5, 3, vEMA3_of_vEMA3_of_vEMA3_of_vRSI14, MAStudy.MA, MAStudy.SIMPLE);
var vLastAlert = -1;

//}}EFSWizard_Declarations 60572


function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(false);
setStudyTitle("TRSI");
setCursorLabelName("SRSI", 0);
setCursorLabelName("SMA ", 1);
setCursorLabelName("DMA ", 2);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarStyle(PS_SOLID, 2);
setDefaultBarFgColor(Color.RGB(139,138,139), 0);
setDefaultBarFgColor(Color.blue, 1);
setDefaultBarFgColor(Color.red, 2);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setDefaultBarThickness(1, 2);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
setPlotType(PLOTTYPE_LINE, 2);
//}}EFSWizard_PreMain 54387

}

function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/

//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
//}}EFSWizard_Expression_1 0

//}}EFSWizard_Expressions 9063


//{{EFSWizard_Return
return new Array(
vEMA3_of_vRSI14.getValue(MAStudy.MA),
vEMA3_of_vEMA3_of_vEMA3_of_vRSI14.getValue(MAStudy.MA),
vSMA5_of_vEMA3_of_vEMA3_of_vEMA3_of_vRSI14.getValue(MAStudy.MA)
);
//}}EFSWizard_Return 19893

}

//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
vLastAlert = 1;
}
//}}EFSWizard_Action_1 5589

//}}EFSWizard_Actions 15622
TohMz
TohMz [at] yahoo.com.sg
2008-06-04 18:34:27
can you email me.
TohMz

2008-06-04 19:21:36
Not well-verse in esignal formula, "Dinapoli Perferred Stochastic" is done by guessing. Need more info from you. Therefore it best that you communicate through TohMz@yahoo.com.sg with me.pls attached your proposed indicator when you email me. Thank you.


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM