Hi,
If anyone knows how to get the following script to update continuously I would appreciated it very much.
Currently after it loads it no longer plots.
apparently the "vSig2/vSig1" in the:
var vSig3 = macd(3, 10, 5, vSig2/vSig1);
var vSig4 = macd(3, 10, 5, vSig2/vSig1);
requires a valid "Source" so it does not update.
Is there a way to have the "vSig2/vSig1" become an updatable source?
Thanks in advance.
RelRel3.efs/************************************************** **************************************************
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.
************************************************** ************************************************** */
var vLoaded = false;
var vEdit = false;
var cSym = "";
var iSym = "$SPX";
var vSig1 = 0;
var vSig2 = 0;
function preMain() {
setPriceStudy(false);
setCursorLabelName("RelRel3");
setStudyTitle("RelRel3-10");
if (vLoaded == false) {
setDefaultBarFgColor(Color.RGB(255,180,0));
setStudyTitle("RelRel3:" + cSym + " & " + iSym );
} else {
if (vEdit == false) {
setStudyTitle("RelRel3:" + cSym + " & " + iSym);
setCursorLabelName(cSym + "\/" + iSym);
} else {
setStudyTitle("RelREl3:" + cSym + " & " + iSym);
setCursorLabelName(cSym + "\/" + iSym);
}
}
setDefaultBarFgColor(Color.magenta,0);
setDefaultBarThickness(2, 0);
setDefaultBarFgColor(Color.cyan,1);
setDefaultBarThickness(1, 1);
setDefaultBarStyle(PS_DOT, 1);
addBand(0, PS_DASHDOTDOT, 1, Color.yellow, "Tag1");
}
function main() {
if (vLoaded == false) {
cSym = getSymbol();
vLoaded = true;
preMain();
}
var vSym = getSymbol();
vSig1 = efsInternal("do_spxRSI",iSym); // this generates the RSI of the SPX
vSig2 = efsInternal("do_securRSI",vSym); // this generates the RSI of the security
var vSig3 = macd(3, 10, 5, vSig2/vSig1); // calcs ratio of the security's RSI to that of the SPX,
// then returns a classic 12-26 macd of it
var vSig4 = macdSignal(3, 10, 5, vSig2/vSig1); // ditto, with the signal line
if((vSig1 != 0) && (vSig2 != 0))
return new Array (vSig3,vSig4);
else
return;
}
function do_spxRSI(Symbol1)
{
if(Symbol1 == "")
return;
var r = 14;
var vValue = rsi(r);
return vValue;
}
function do_securRSI(Symbol2)
{
if(Symbol2 == "")
return;
var r = 14;
var vValue = rsi(r);
return vValue;
}
If anyone knows how to get the following script to update continuously I would appreciated it very much.
Currently after it loads it no longer plots.
apparently the "vSig2/vSig1" in the:
var vSig3 = macd(3, 10, 5, vSig2/vSig1);
var vSig4 = macd(3, 10, 5, vSig2/vSig1);
requires a valid "Source" so it does not update.
Is there a way to have the "vSig2/vSig1" become an updatable source?
Thanks in advance.
RelRel3.efs/************************************************** **************************************************
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.
************************************************** ************************************************** */
var vLoaded = false;
var vEdit = false;
var cSym = "";
var iSym = "$SPX";
var vSig1 = 0;
var vSig2 = 0;
function preMain() {
setPriceStudy(false);
setCursorLabelName("RelRel3");
setStudyTitle("RelRel3-10");
if (vLoaded == false) {
setDefaultBarFgColor(Color.RGB(255,180,0));
setStudyTitle("RelRel3:" + cSym + " & " + iSym );
} else {
if (vEdit == false) {
setStudyTitle("RelRel3:" + cSym + " & " + iSym);
setCursorLabelName(cSym + "\/" + iSym);
} else {
setStudyTitle("RelREl3:" + cSym + " & " + iSym);
setCursorLabelName(cSym + "\/" + iSym);
}
}
setDefaultBarFgColor(Color.magenta,0);
setDefaultBarThickness(2, 0);
setDefaultBarFgColor(Color.cyan,1);
setDefaultBarThickness(1, 1);
setDefaultBarStyle(PS_DOT, 1);
addBand(0, PS_DASHDOTDOT, 1, Color.yellow, "Tag1");
}
function main() {
if (vLoaded == false) {
cSym = getSymbol();
vLoaded = true;
preMain();
}
var vSym = getSymbol();
vSig1 = efsInternal("do_spxRSI",iSym); // this generates the RSI of the SPX
vSig2 = efsInternal("do_securRSI",vSym); // this generates the RSI of the security
var vSig3 = macd(3, 10, 5, vSig2/vSig1); // calcs ratio of the security's RSI to that of the SPX,
// then returns a classic 12-26 macd of it
var vSig4 = macdSignal(3, 10, 5, vSig2/vSig1); // ditto, with the signal line
if((vSig1 != 0) && (vSig2 != 0))
return new Array (vSig3,vSig4);
else
return;
}
function do_spxRSI(Symbol1)
{
if(Symbol1 == "")
return;
var r = 14;
var vValue = rsi(r);
return vValue;
}
function do_securRSI(Symbol2)
{
if(Symbol2 == "")
return;
var r = 14;
var vValue = rsi(r);
return vValue;
}
Comment