I got a big problem coding in the efs editor because i cant write the code so well yet... so i use the formula wizzard but there i have the problem that i cant use non standart formulas ... so here is my question :
Is there a way to make non standart formulas ready for the formula wizzard ... ?
when not can anybody code me a snippet that colors the background green and red when the 2 lines are crossing ???
here is the code for the formula i mean
thank you and regards .... eric
Is there a way to make non standart formulas ready for the formula wizzard ... ?
when not can anybody code me a snippet that colors the background green and red when the 2 lines are crossing ???
here is the code for the formula i mean
/************************************************** **************************************************
Copyright © eSignal, a division of Interactive Data Corporation. 2003. All rights reserved.
This sample eSignal Formula Script (EFS) may be modified and saved under a new
filename; however, eSignal is no longer responsible for the functionality once modified.
eSignal reserves the right to modify and overwrite this EFS file with each new release.
************************************************** ************************************************** */
/*** 5/9/03 Corrected Version
* Fixed flat-line bug for infrequently traded securities
***/
addBand(80, PS_SOLID, 1, Color.grey, "Upper");
addBand(20, PS_SOLID, 1, Color.black, "Lower");
function preMain()
{
setStudyTitle("Preferred Stochastic");
setCursorLabelName("percentK", 0);
setCursorLabelName("percentD", 1);
setDefaultBarFgColor(Color.lime, 0);
setDefaultBarFgColor(Color.red, 1);
}
var MAVt = null;
var MAVt1 = null;
var MAVt_1 = 0;
var MAVt1_1 = 0;
function main(nLength, nSmoothing, nSmoothings) {
if(nLength == null)
nLength = 8;
if(nSmoothing == null)
nSmoothing = 3;
if(nSmoothings == null)
nSmoothings = 3;
var percentK;
var ll = 0, hh = 0;
var sum = 0;
var vHigh = getValue("High", 0, -nLength);
var vLow = getValue("Low", 0, -nLength);
var temp = 0;
if(vHigh == null || vLow == null)
return;
for(j = 0; j < nLength; j++) {
if(j == 0) {
ll = vLow[j];
hh = vHigh[j];
} else {
hh = Math.max(hh, vHigh[j]);
ll = Math.min(ll, vLow[j]);
}
}
percentK = ((close() - ll) / (hh - ll)) * 100;
if (isNaN(percentK) == false) MAVt = MAVt_1 + (percentK - MAVt_1) / nSmoothing;
if (getBarState() == BARSTATE_NEWBAR) MAVt_1 = MAVt;
if (isNaN(percentK) == false) MAVt1 = MAVt1_1 + (MAVt - MAVt1_1) / nSmoothings;
if (getBarState() == BARSTATE_NEWBAR) MAVt1_1 = MAVt1;
return new Array(MAVt,MAVt1);
}
Copyright © eSignal, a division of Interactive Data Corporation. 2003. All rights reserved.
This sample eSignal Formula Script (EFS) may be modified and saved under a new
filename; however, eSignal is no longer responsible for the functionality once modified.
eSignal reserves the right to modify and overwrite this EFS file with each new release.
************************************************** ************************************************** */
/*** 5/9/03 Corrected Version
* Fixed flat-line bug for infrequently traded securities
***/
addBand(80, PS_SOLID, 1, Color.grey, "Upper");
addBand(20, PS_SOLID, 1, Color.black, "Lower");
function preMain()
{
setStudyTitle("Preferred Stochastic");
setCursorLabelName("percentK", 0);
setCursorLabelName("percentD", 1);
setDefaultBarFgColor(Color.lime, 0);
setDefaultBarFgColor(Color.red, 1);
}
var MAVt = null;
var MAVt1 = null;
var MAVt_1 = 0;
var MAVt1_1 = 0;
function main(nLength, nSmoothing, nSmoothings) {
if(nLength == null)
nLength = 8;
if(nSmoothing == null)
nSmoothing = 3;
if(nSmoothings == null)
nSmoothings = 3;
var percentK;
var ll = 0, hh = 0;
var sum = 0;
var vHigh = getValue("High", 0, -nLength);
var vLow = getValue("Low", 0, -nLength);
var temp = 0;
if(vHigh == null || vLow == null)
return;
for(j = 0; j < nLength; j++) {
if(j == 0) {
ll = vLow[j];
hh = vHigh[j];
} else {
hh = Math.max(hh, vHigh[j]);
ll = Math.min(ll, vLow[j]);
}
}
percentK = ((close() - ll) / (hh - ll)) * 100;
if (isNaN(percentK) == false) MAVt = MAVt_1 + (percentK - MAVt_1) / nSmoothing;
if (getBarState() == BARSTATE_NEWBAR) MAVt_1 = MAVt;
if (isNaN(percentK) == false) MAVt1 = MAVt1_1 + (MAVt - MAVt1_1) / nSmoothings;
if (getBarState() == BARSTATE_NEWBAR) MAVt1_1 = MAVt1;
return new Array(MAVt,MAVt1);
}
Comment