Announcement

Collapse
No announcement yet.

Options on menu disappear?!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Options on menu disappear?!

    Ever since I've been using/writing EFS studies I've been having the problem of
    the chart menu options "Remove Study, Reload Study" disappearing from the right click menu? (right click on any portion of the chart and remove/reaload options are gone).

    My code runs fine and back tests fine. Is there something I'm supposed to be doing upon script exit to 'clear' the state back to normal.

    It pretty much always does it with this study loaded. (sorry for the messy code, starting making this one in Wizard then moved to the EFS editor)

    PHP Code:
    var vEMA8 = new MAStudy(500"Close"MAStudy.EXPONENTIAL);
    var 
    vEMA21 = new MAStudy(1300"Close"MAStudy.EXPONENTIAL);
    var 
    vLastAlert = -1;


    function 
    preMain() {
    //Code_PreMain_setPriceBarColor
    setColorPriceBars(true);
    //Code_PreMain_setPriceBarColor
       /**
        *  This function is called only once, before any of the bars are loaded.
        *  Place any study or EFS configuration commands here.
        */
        
    setPriceStudy(true);
        
    setStudyTitle("Base Strategy BETA 1.1");
        
    setCursorLabelName("fast"0);
        
    setCursorLabelName("slow"1);
        
    setDefaultBarStyle(PS_SOLID0);
        
    setDefaultBarStyle(PS_SOLID1);
        
    setDefaultBarFgColor(Color.red0);
        
    setDefaultBarFgColor(Color.white1);
        
    setDefaultBarThickness(10);
        
    setDefaultBarThickness(11);
        
    setPlotType(PLOTTYPE_LINE0);
        
    setPlotType(PLOTTYPE_LINE1);
        
    AllowTrading true
        
    daynow = new Date();
        
    size 100;
    //    size = Strategy.getDefaultLotSize(); (doesnt pass from backtester for some reason

    //  Below are variables passed from the edit studies configure menu. 

        
    gStop = new FunctionParameter("gStop"FunctionParameter.NUMBER);
        
    gStop.setDefault(20); 
        
    gStop.setName("Hard Stop"); // NOT IMPLIMENTD YET

        
    gParam2 = new FunctionParameter("gParam2"FunctionParameter.NUMBER);
        
    gParam2.setDefault100 ); 
        
    gParam2.setName("Parameter 2"); // FUTURE

        
    gParam3 = new FunctionParameter("gParam3"FunctionParameter.NUMBER);
        
    gParam3.setDefault100 ); 
        
    gParam3.setName("Parameter 3"); // FUTURE

    }

    function 
    main(gStopgParam2gParam3) {
       
    /**
        *  The main() function is called once per bar on all previous bars, once per
        *  each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
        *  in your preMain(), it is also called on every tick.
        */

    // Geoff Get Time
        
    var Time = (hour(0)*100)+minute(0);
        
    AllowTrading true;
    //  debugPrintln(Time);

    // EXIT TRADES AT BEGINNING OF DZ
       
    if(Time == 1200 && Strategy.isInTrade() && Strategy.isShort() ) {
       
    AllowTrading false;
       
    Strategy.doCover"DZ Exit Short"Strategy.CLOSEStrategy.THISBARStrategy.ALL ); }
       else if (
    Time == 1200 && Strategy.isInTrade() && Strategy.isLong() ) {
       
    AllowTrading false;
       
    Strategy.doSell"DZ Exit Long"Strategy.CLOSEStrategy.THISBARStrategy.ALL); }
    // END DZ EXIT CODE

    // EXIT TRADES AT EOD
       
    if(Time == 1559 && Strategy.isInTrade() && Strategy.isShort() ) {
       
    AllowTrading false;
       
    Strategy.doCover"EOD Short Signal"Strategy.CLOSEStrategy.THISBARStrategy.ALL ); }
       else if (
    Time == 1559 && Strategy.isInTrade() && Strategy.isLong() ) {
       
    AllowTrading false;
       
    Strategy.doSell"EOD Long Signal"Strategy.CLOSEStrategy.THISBARStrategy.ALL); }
    // END EOD EXIT CODE


        //{{Test for dead zone. If found goto Action1
            
    if (
                
    Time >= 1200 &&
                
    Time 1415
            
    onAction1()
        
    //}}END DZ TEST
          
        //{{Check to see if it's Friday and go lighter shares
            
    if (
                
    daynow.getDay() == 5
            
    onAction3()
        
    //}}END FRIDAY CHECK
            
        
        //{{STRATEGY CODE -------REPLACE THIS WITH SOMETHING GOOD
             
    if (
                
    vEMA8.getValue(MAStudy.MA) <= vEMA21.getValue(MAStudy.MA) &&
                
    AllowTrading == true
            
    onAction4()
        
    //}}
        
        //{{
             
    else if (
                
    vEMA8.getValue(MAStudy.MA) >= vEMA21.getValue(MAStudy.MA) &&
                
    AllowTrading == true
            
    onAction5()
            
      
        
    //{{Return Values for MAS for graphic plotting
            
    return new Array(
                
    vEMA8.getValue(MAStudy.MA),
                
    vEMA21.getValue(MAStudy.MA)
            );
        
    //}}END ARRARY RETURN
        
        //}}END STRATEGY CODE ----------------------------------------------


    }



    //{{Actions
        //{{Action_1
        
    function onAction1() {
            
    AllowTrading false;
            
    vLastAlert 1;       
        }
        
    //}}END Action_1
        
        
        //{{Action_3
        
    function onAction3() {
           
    // if (vLastAlert != 3) size = (size / 2);
           // vLastAlert = 3;       
        
    }
        
    //}}END Action_3
        
        //{{Action_4
        
    function onAction4() {
            
    setPriceBarColor(Color.red);
            if (
    vLastAlert != 5Strategy.clearStop();
            if (
    vLastAlert != 4Strategy.doShort("Short Entry"Strategy.CLOSEStrategy.THISBARStrategy.DEFAULT, 0);
          
    //  if (vLastAlert != 5) Strategy.setStop( close(0)+gStop );
            
    vLastAlert 4;    
        }
        
    //}}END Action_4
        
        //{{Action_5
        
    function onAction5() {
            
    setPriceBarColor(Color.blue);
            if (
    vLastAlert != 5Strategy.clearStop();
            if (
    vLastAlert != 5Strategy.doLong("Long Entry"Strategy.CLOSEStrategy.THISBARStrategy.DEFAULT, 0);
          
    //  if (vLastAlert != 5) Strategy.setStop( close(0)-gStop );         
            
    vLastAlert 5;       
        }
        
    //}}END Action_5



  • #2
    Hello Geoff,

    You have to have at least one formula applied to a chart in order for those menu options to be available. They will not be present if the chart does not have a formula to be removed or reloaded.

    I tested the formula you posted and as long as it is applied to the chart the remove/reload options are present. Please let me know if I've misunderstood your question.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      This study was applied to the chart at the time this happened. I could go to Edit studies and see it there but the remove/reload option was missing from the right click menu. To fix this I have to exit and reload eSignal. Its curious.. It happened a few times yesterday but not as frequently. I have been putting a lot of stress on esignal. Creating loads of back test files, having tons of charts open at once, etc. It may be my code or I may just be hitting some obsecure bug no one has found. If I can reproduce it consistantly I will let you know so you can do the same and maybe report a problem.

      Ttyl

      Comment

      Working...
      X