Hi!
I am using the following Ichimoku study and am trying to get all of the lines that make up the Kumo to be dotted instead of solid. The changes that I made to lines 80,187 and 188 have done so to all of the vertical lines that make up the cloud and also to the 26 period offset. But I am unable to get the solid lines that create the Senkou Span A and B of the prior and current candles to change. I know that these changes can be made if you edit the settings, but I was hoping to set this default in the efs itself.
Thank you in advance.
I am using the following Ichimoku study and am trying to get all of the lines that make up the Kumo to be dotted instead of solid. The changes that I made to lines 80,187 and 188 have done so to all of the vertical lines that make up the cloud and also to the 26 period offset. But I am unable to get the solid lines that create the Senkou Span A and B of the prior and current candles to change. I know that these changes can be made if you edit the settings, but I was hoping to set this default in the efs itself.
Thank you in advance.
PHP Code:
/*********************************
Provided By:
eSignal (Copyright © eSignal), a division of Interactive Data
Corporation. 2007. 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.
Version: 2.0 (8/7/2007)
Notes:
8/7/2007
* Study has been updated to utilize EFS2 functionality
* Additional formula parameters added to match built-in
study parameters found in FutureSource Workstation
Ichimoku study.
**********************************/
// Global Variables
var aFPArray = null;
var xTurn = null;
var xStd = null;
var xLS1 = null;
var xLS2 = null;
var xKumoStyle = null;
var bInit = false; // Initialization flag
var vCntr = 0; // bar counter
var vICntr = 0; // line counter for drawn lines
function preMain() {
setPriceStudy(true);
setStudyTitle("Ichimoku Kinko Hyo");
setCursorLabelName("Tenkan Sen", 0);
setCursorLabelName("Kijun Sen", 1);
setCursorLabelName("Chikou Span", 2);
setCursorLabelName("Senkou Span A", 3);
setCursorLabelName("Senkou Span B", 4);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarFgColor(Color.blue, 1);
setDefaultBarFgColor(Color.magenta, 2);
setDefaultBarFgColor(Color.lightgrey, 3);
setDefaultBarFgColor(Color.purple, 4);
setShowTitleParameters(false);
var i = 0;
aFPArray = new Array();
aFPArray[i] = new FunctionParameter("nTrnPeriod", FunctionParameter.NUMBER);
aFPArray[i].setName("Tenkan Sen Periods");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(9);
++i;
aFPArray[i] = new FunctionParameter("nStdPeriod", FunctionParameter.NUMBER);
aFPArray[i].setName("Kijun Sen Periods");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(26);
++i;
aFPArray[i] = new FunctionParameter("nLS2Period", FunctionParameter.NUMBER);
aFPArray[i].setName("Senkou Span B Periods");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(52);
++i;
aFPArray[i] = new FunctionParameter("nOffset", FunctionParameter.NUMBER);
aFPArray[i].setName("Displacement");
aFPArray[i].setLowerLimit(0);
aFPArray[i].setDefault(26);
++i;
aFPArray[i] = new FunctionParameter("sCloud", FunctionParameter.STRING);
aFPArray[i].setName("Ichimoku Kumo Style");
aFPArray[i].addOption( "Solid Line" );
aFPArray[i].addOption( "Dotted Line" );
aFPArray[i].setDefault("Dotted Line"); /*Dot*/
++i;
aFPArray[i] = new FunctionParameter("cCloudUp", FunctionParameter.COLOR);
aFPArray[i].setName("Ichimoku Kumo Color Up");
aFPArray[i].setDefault(Color.grey);
++i;
aFPArray[i] = new FunctionParameter("cCloudDown", FunctionParameter.COLOR);
aFPArray[i].setName("Ichimoku Kumo Color Down");
aFPArray[i].setDefault(Color.grey);
++i;
aFPArray[i] = new FunctionParameter("nColorTrn", FunctionParameter.COLOR);
aFPArray[i].setName("Line Color: Tenkan Sen");
aFPArray[i].setDefault(Color.green);
++i;
aFPArray[i] = new FunctionParameter("nColorStd", FunctionParameter.COLOR);
aFPArray[i].setName("Line Color: Kijun Sen");
aFPArray[i].setDefault(Color.blue);
++i;
aFPArray[i] = new FunctionParameter("nColorDelay", FunctionParameter.COLOR);
aFPArray[i].setName("Line Color: Chikou Span");
aFPArray[i].setDefault(Color.magenta);
++i;
aFPArray[i] = new FunctionParameter("nColorLS1", FunctionParameter.COLOR);
aFPArray[i].setName("Line Color: Senkou Span A");
aFPArray[i].setDefault(Color.lightgrey);
++i;
aFPArray[i] = new FunctionParameter("nColorLS2", FunctionParameter.COLOR);
aFPArray[i].setName("Line Color: Senkou Span B");
aFPArray[i].setDefault(Color.purple);
++i;
aFPArray[i] = new FunctionParameter("nThickTrn", FunctionParameter.NUMBER);
aFPArray[i].setName("Line Thickness: Tenkan Sen");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(2);
++i;
aFPArray[i] = new FunctionParameter("nThickStd", FunctionParameter.NUMBER);
aFPArray[i].setName("Line Thickness: Kijun Sen");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(1);
++i;
aFPArray[i] = new FunctionParameter("nThickDelay", FunctionParameter.NUMBER);
aFPArray[i].setName("Line Thickness: Chikou Span");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(1);
++i;
aFPArray[i] = new FunctionParameter("nThickLS1", FunctionParameter.NUMBER);
aFPArray[i].setName("Line Thickness: Senkou Span A");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(1);
++i;
aFPArray[i] = new FunctionParameter("nThickLS2", FunctionParameter.NUMBER);
aFPArray[i].setName("Line Thickness: Senkou Span B");
aFPArray[i].setLowerLimit(1);
aFPArray[i].setDefault(1);
}
function main( nTrnPeriod, nStdPeriod, nLS2Period, nOffset, sCloud, cCloudUp, cCloudDown,
nColorTrn, nColorStd, nColorDelay, nColorLS1, nColorLS2,
nThickTrn, nThickStd, nThickDelay, nThickLS1, nThickLS2) {
if (bInit == false) {
setDefaultBarFgColor(nColorTrn, 0);
setDefaultBarFgColor(nColorStd, 1);
setDefaultBarFgColor(nColorDelay, 2);
setDefaultBarFgColor(nColorLS1, 3);
setDefaultBarFgColor(nColorLS2, 4);
setDefaultBarThickness(nThickTrn, 0);
setDefaultBarThickness(nThickStd, 1);
setDefaultBarThickness(nThickDelay, 2);
setDefaultBarThickness(nThickLS1, 3);
setDefaultBarThickness(nThickLS2, 4);
xTurn = middleDonchian(nTrnPeriod);
xStd = middleDonchian(nStdPeriod);
xLS1 = offsetSeries(efsInternal("calcLS1", xStd, xTurn), nOffset);
xLS2 = offsetSeries(middleDonchian(nLS2Period), nOffset);
xKumoStyle = PS_SOLID;
if(sCloud != null && sCloud == "Dotted Line") xKumoStyle = PS_DOT;
bInit = true;
}
// added by gekko71
if ( isLastBarOnChart() ) {
if(nOffset > 0) {
var i;
for(i=0; i<nOffset; ++i) {
var vSenkouACurr = xLS1.getValue(i);
var vSenkouANext = xLS1.getValue(i+1);
var vSenkouBCurr = xLS2.getValue(i);
var vSenkouBNext = xLS2.getValue(i+1);
drawLineRelative(i, vSenkouACurr, (i+1), vSenkouANext, PS_DOT, 1, nColorLS1, (i+"A")); /*Dot*/
drawLineRelative(i, vSenkouBCurr, (i+1), vSenkouBNext, PS_DOT, 1, nColorLS2, (i+"B")); /*Dot*/
if(vSenkouACurr > vSenkouBCurr) {
if(i == (nOffset - 1))
drawLineRelative((i+1), vSenkouANext, (i+1), vSenkouBNext, xKumoStyle, 1, cCloudUp, "CloudUpExt"+(i+1));
drawLineRelative(i, vSenkouACurr, i, vSenkouBCurr, xKumoStyle, 1, cCloudUp, "CloudUpExtCurr"+i);
}
if(vSenkouACurr < vSenkouBCurr) {
if(i == (nOffset - 1))
drawLineRelative((i+1), vSenkouANext, (i+1), vSenkouBNext, xKumoStyle, 1, cCloudDown, "CloudDownExt"+(i+1));
drawLineRelative(i, vSenkouACurr, i, vSenkouBCurr, xKumoStyle, 1, cCloudDown, "CloudDownExtCurr"+i);
}
}
}
}
if(getBarState() == BARSTATE_NEWBAR) {
vCntr++;
vICntr++;
if (vICntr > 350) vICntr = 0;
}
var nTurningLine = xTurn.getValue(0);
var nStandardLine = xStd.getValue(0);
var nLeadingSpan1 = xLS1.getValue(0);
var nLeadingSpan2 = xLS2.getValue(0);
if (nTurningLine == null || nStandardLine == null || nLeadingSpan1 == null || nLeadingSpan2 == null) return;
if(nLeadingSpan1 > nLeadingSpan2)
drawLineRelative(0, nLeadingSpan1, 0, nLeadingSpan2, xKumoStyle, 1, cCloudUp, "CloudUp" + vICntr);
if(nLeadingSpan1 < nLeadingSpan2)
drawLineRelative(0, nLeadingSpan1, 0, nLeadingSpan2, xKumoStyle, 1, cCloudDown, "CloudDown" + vICntr);
if (nOffset > 0) {
var nNum = 0;
if(getBarState() == BARSTATE_NEWBAR) nNum = 1;
if(getBuildNumber()>636){
setBar(Bar.Value, -nOffset, 2, close(0));
} else {
setBar(Bar.Value, (-nOffset + nNum), new Array(null, null, close(0), null, null));
}
return new Array(nTurningLine, nStandardLine, null, nLeadingSpan1, nLeadingSpan2);
} else {
return new Array(nTurningLine, nStandardLine, close(0), nLeadingSpan1, nLeadingSpan2);
}
}
function calcLS1( xSTD, xTRN ) {
return (xSTD.getValue(0) + xTRN.getValue(0)) / 2;
}
Comment