Need help to convert indicator from Esignal to Tradestation

post your indicators here

Moderator: moderators

Shane280us
rank: <50 posts
rank: <50 posts
Posts: 24
Joined: Sat May 12, 2007 1:04 am
Reputation: 0
Location: Dallas, Texas, USA
Gender: Male

Need help to convert indicator from Esignal to Tradestation

Postby Shane280us » Sun Jul 22, 2007 10:25 pm

I created this indicator sometime ago with Esignal and while the programing is probably not correct, the indicator has provided me with what I wanted. But I've just changed over to Tradestation and I'm at a loss as to how to convert this indicator. It took me along time to fiddle with Esignal (a programer I'm not) to get it right. Is there anyone that could possible convert my Esignal indicator to Tradestation ELD for me please. I'm totally new to Tradestation and just don't know where to begin with the recoding this.

*******************************************************
Created by Shane Spriggins
**********************************************************/

var fpArray = new Array();
var fp2Array = new Array();
var vStoch14_3 = new StochStudy(14, 3, 3);
function preMain() {

setPriceStudy(false);
setStudyTitle("Stochastic Histogram Var SSO6");
setCursorLabelName("%K",0);
setCursorLabelName("%D2",3);
setDefaultBarFgColor(Color.RGB(120,155,127),1);
setDefaultBarFgColor(Color.RGB(120,155,127),2);
setDefaultBarFgColor(Color.yellow, 3);
setPlotType(PLOTTYPE_HISTOGRAM,0);
setPlotType(PLOTTYPE_DOT,1);
setPlotType(PLOTTYPE_DOT,2);
setPlotType(PLOTTYPE_LINE,3);
setDefaultBarThickness(6,0);
setDefaultBarThickness(0,1);
setDefaultBarThickness(0,2);
setDefaultBarThickness(2,3);
setHistogramBase(50,0);
setHistogramBase(50,3);
askForInput();

var x=0;
fpArray[x] = new FunctionParameter("Dotline", FunctionParameter.STRING);
with(fpArray[x++]){
setName("Swing: Wave Type");
addOption("% Retracement");
addOption("% Change in Price");
setDefault("% Change in Price");
}
fpArray[x] = new FunctionParameter("KLength", FunctionParameter.NUMBER);
with(fpArray[x++]){
setName("%K");
setLowerLimit(1);
setDefault(14);
}
fpArray[x] = new FunctionParameter("KSmoothing", FunctionParameter.NUMBER);
with(fpArray[x++]){
setName("%KSmooth");
setLowerLimit(1);
setDefault(3);
}
fpArray[x] = new FunctionParameter("DLength", FunctionParameter.NUMBER);
with(fpArray[x++]){
setName("%D");
setLowerLimit(1);
setDefault(3);
}
fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("Upper", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(0);
setDefault(80);
addOption("75");
addOption("70");
}
fpArray[x] = new FunctionParameter("Lower", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(0);
setDefault(20);
addOption("25");
addOption("30");
}
fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
with(fpArray[x++]){
setName("Show Parameters");
setDefault(false);
}
var x2=0;
fp2Array[x2] = new FunctionParameter("K2Length", FunctionParameter.NUMBER);
with(fp2Array[x2++]){
setName("%K2");
setLowerLimit(1);
setDefault(14);
}
fp2Array[x2] = new FunctionParameter("K2Smoothing", FunctionParameter.NUMBER);
with(fp2Array[x2++]){
setName("%KSmooth2");
setLowerLimit(1);
setDefault(1);
}
fp2Array[x2] = new FunctionParameter("D2Length", FunctionParameter.NUMBER);
with(fp2Array[x2++]){
setName("%D2");
setLowerLimit(1);
setDefault(3);
}
fp2Array[x2] = new FunctionParameter("Symbol2", FunctionParameter.STRING);
with(fp2Array[x2++]){
setDefault();
}
fp2Array[x2] = new FunctionParameter("Interval2", FunctionParameter.STRING);
with(fp2Array[x2++]){
setDefault();
}
fp2Array[x2] = new FunctionParameter("Params2", FunctionParameter.BOOLEAN);
with(fp2Array[x2++]){
setName("Show Parameters");
setDefault(false);
}

}

var bInit = false;
var xStochK = null;
var xStochD = null;
var bInit = false;
var x2StochK = null;
var x2StochD = null;


function main(KLength,KSmoothing,DLength,K2Length,K2Smoothing,D2Length,Symbol,Interval,Symbol2,Interval2,Upper,Lower,Params,Params2,Dotline) {
var nK_0 = vStoch14_3.getValue(StochStudy.FAST, 0);
var nK_1 = vStoch14_3.getValue(StochStudy.FAST, -1);
var nK_2 = vStoch14_3.getValue(StochStudy.FAST, -2);

if (nK_0 > 50 && nK_0 > nK_1) { // cross up green
setBarFgColor(Color.lime);
}
if (nK_0 > 50 && nK_0 < nK_1) {
setBarFgColor(Color.RGB(0,128,0));
}
if (nK_0 < 50 && nK_0 < nK_1) { // cross down red
setBarFgColor(Color.RGB(255,65,65));
}
else if (nK_0 < 50 && nK_0 > nK_1) {
setBarFgColor(Color.RGB(192,0,0));
}
if(bInit == false){
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
var vSymbol = Symbol+","+Interval;
xStochK = stochK(KLength,KSmoothing,DLength,sym(vSymbol));
xStochD = stochD(KLength,KSmoothing,DLength,sym(vSymbol));
x2StochK = stochK(K2Length,K2Smoothing,D2Length,sym(vSymbol));
x2StochD = stochD(K2Length,K2Smoothing,D2Length,sym(vSymbol));
addBand( Upper, PS_DASH, 2, Color.black,"Upper");
addBand( Lower, PS_DASH, 2, Color.black,"Lower");
addBand( 50, PS_SOLID, 2, Color.red,"Middle");
addBand( 75, PS_SOLID, 1, Color.RGB(0,221,221),"Buy Zone U");
addBand( 25, PS_SOLID, 1, Color.RGB(0,221,221),"Buy Zone L");
addBand( 90, PS_DASH, 2, Color.RGB(0,70,255),"Buy Zone S");
addBand( 10, PS_DASH, 2, Color.RGB(0,70,255),"Buy Zone B");
setShowTitleParameters(eval(Params));
bInit = true;
}




return new Array (getSeries(xStochK),getSeries(xStochD),getSeries(x2StochK),getSeries(x2StochD));
}
Attachments
SSO indicator.jpg.png
SSO indicator.jpg.png (34.66 KiB) Viewed 281 times

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 11430
Joined: Sun May 14, 2006 9:31 pm
Reputation: 45
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Mon Jul 23, 2007 7:40 pm

Check in the Motherlodes... I know I have coded a few Stochastic indicators.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!

Please do NOT PM me with trading or coding questions, post them in a thread.

Shane280us
rank: <50 posts
rank: <50 posts
Posts: 24
Joined: Sat May 12, 2007 1:04 am
Reputation: 0
Location: Dallas, Texas, USA
Gender: Male

Postby Shane280us » Tue Jul 24, 2007 10:04 pm

Avery,

Thanks I'll start looking through them to see if I can find what I'm looking for.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “Tradestation indicators”