I just upgraded to the newest version of egignal and now I am having difficulty with efs studies which worked fine on the prior version. Is there a way to reload a prior version while I figure out the problem?
Alan
Alan
var MA1 = null;
var MA2 = null;
var aa1 = null;
var aa11 = null;
var sMA1,sMA2,saa1,saa11,paa1,paa11,pp,bInit; // added
function preMain() {
setPriceStudy(false);
setStudyTitle(" Logic 96mod986test1");
setCursorLabelName("MA1", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarStyle(PS_SOLID, 2);
setDefaultBarFgColor(Color.black, 0);
setDefaultBarFgColor(Color.black, 1);
setDefaultBarFgColor(Color.black, 2);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setDefaultBarThickness(1, 2);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
setPlotType(PLOTTYPE_LINE, 2);
//~ Symbol1 = getSymbol(); //NOT HERE
//~ Interval1 = "1";
}
paa1=null,paa11=null,pp=null; // added
function main() {
pp = 0;
if(!bInit){ // added this section and changed content
var Symbol1 = getSymbol();
var Interval1 = "1";
var vSymbol1 = Symbol1+","+Interval1;// the variables u defined in pre-Main are not visible here
sMA1 = efsInternal("myFunction1",sym(vSymbol1));
sMA2 = efsInternal("myFunction2",sym(vSymbol1));
saa1 = efsInternal("myFunction3",sym(vSymbol1));
saa11 = efsInternal("myFunction4",sym(vSymbol1));
MA1=sMA1.getSeries();
MA2=sMA2.getSeries();
aa1=saa1.getSeries();
aa11=saa11.getSeries();
bInit=true;
}
if(MA1.getValue(0) >= MA2.getValue(0)) { //same conditional as below, why??
setBarThickness(3,0);
setBarFgColor(Color.blue,0);
}
if(MA2.getValue(0) >= MA1.getValue(0)) {
setBarThickness(1,0);
setBarFgColor(Color.black,0);
paa1 = 0;
}
else{
paa1=aa1.getValue(0);
}
if(MA2.getValue(0) >= MA1.getValue(0)) {
setBarThickness(3,1);
setBarFgColor(Color.blue,1);
}
if(MA1.getValue(0) >= MA2.getValue(0)) {
setBarThickness(1,1);
setBarFgColor(Color.black,1);
paa11 = 0;
}
else{
paa11=aa11.getValue(0);
}
return new Array (paa1, paa11, pp);
}
function myFunction1(){
var MA1 = sma(7,close())
return MA1
}
function myFunction2(){
var MA2 = sma(25,close())
return MA2
}
function myFunction3(){
var MA1 = sma(7,close())
var MA3 = sma(25,close())
var aa1=0; // local variable added
if(MA1.getValue(0) >= MA3.getValue(0)) {
aa1 = 4;
}
else if(MA3.getValue(0) >= MA1.getValue(0)) {
aa1 = 0;
}
return aa1
}
function myFunction4(){
var MA2 = sma(7,close())
var MA3 = sma(25,close())
var aa11=0; // local variable added
if(MA2.getValue(0) >= MA3.getValue(0)) {
aa11 = -4;
}
else if(MA3.getValue(0) >= MA2.getValue(0)) {
aa11 = -4;
}
return aa11
}
debugClear();
var bInit = false;
function preMain() {
setPriceStudy(false);
setStudyTitle(" Logic 96mod986test1d");
setCursorLabelName("MA1", 0);
setCursorLabelName("MA2", 1);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarFgColor(Color.black, 0);
setDefaultBarFgColor(Color.black, 1);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
}
var Symbol1 = null;
var vSymbol1 = null;
var Interval1 = null;
var MAStudy1 = null;
var MAStudy2 = null;
var aa1 = null;
var aa11 = null;
function main() {
var MA1, MA2;
if(!bInit){
Symbol1 = getSymbol();
Interval1 = "1";
vSymbol1 = Symbol1+","+Interval1;
MAStudy1 = sma(7,close(sym(vSymbol1)));
MAStudy2 = sma(25,close(sym(vSymbol1)));
addBand(0, PS_SOLID, 1 , Color.black, "ZeroLine" );
bInit=true;
}
MA1 = MAStudy1.getValue(0);
MA2 = MAStudy2.getValue(0);
aa11 = -4;
if(MA1 >= MA2) {
setBarThickness(3,0);
setBarFgColor(Color.blue,0);
setBarThickness(1,1);
setBarFgColor(Color.black,1);
aa1 = 4;
aa11 = 0;
}else if(MA2 >= MA1) {
setBarThickness(1,0);
setBarFgColor(Color.black,0);
setBarThickness(3,1);
setBarFgColor(Color.blue,1);
aa1 = 0;
}
return new Array (aa1, aa11);
}
debugClear();
var bInit = false;
var grID = 0;
function preMain() {
setPriceStudy(false);
setStudyTitle(" Logic 96mod986test1f");
setCursorLabelName("MA1", 0);
setCursorLabelName("MA2", 1);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarFgColor(Color.black, 0);
setDefaultBarFgColor(Color.black, 1);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
}
var Symbol1 = null;
var vSymbol1 = null;
var Interval1 = null;
var MAStudy1 = null;
var MAStudy2 = null;
var aa1 = null;
var aa11 = null;
function main() {
var MA1, MA2;
if(!bInit){
Symbol1 = getSymbol();
Interval1 = getInterval();
if(!isIntraday() || Interval1 != 1){
displayError("ERR: Chart must have a 1 minute interval");
return;
}
vSymbol1 = Symbol1+","+Interval1;
MAStudy1 = sma(7,close(sym(vSymbol1)));
MAStudy2 = sma(25,close(sym(vSymbol1)));
addBand(0, PS_SOLID, 1 , Color.black, "ZeroLine" );
bInit=true;
}
MA1 = MAStudy1.getValue(0);
MA2 = MAStudy2.getValue(0);
aa11 = -4;
if(MA1 >= MA2) {
setBarThickness(3,0);
setBarFgColor(Color.blue,0);
setBarThickness(1,1);
setBarFgColor(Color.black,1);
aa1 = 4;
aa11 = 0;
}else if(MA2 >= MA1) {
setBarThickness(1,0);
setBarFgColor(Color.black,0);
setBarThickness(3,1);
setBarFgColor(Color.blue,1);
aa1 = 0;
}
return new Array (aa1, aa11);
}
/*************************************************
SUPPORT FUNCTIONS
**************************************************/
//== gID function assigns unique identifier to graphic/text routines
function gID() {
grID ++;
return( grID );
}
//== displayError function displays an error to the user
function displayError( ErrStr ) {
clearText();
drawTextRelative(20, 50, ErrStr, Color.maroon, Color.lightgrey, Text.FRAME | Text.ONTOP | Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM, null, 16, gID());
}
Comment