Announcement

Collapse
No announcement yet.

User defined lunch time chart color change

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

  • User defined lunch time chart color change

    I am trying to add both an option and color change to the foreground color if we are in the middle of a defined period for lunch. That way I am at least alerting myself visually to that time frame. Showing below is what I added to a bigger efs file, but nothing is showing up.

    Any help is of course much appreciated. Thanks.

    PHP Code:
    var lsTime=1130//lunch start time
    var leTime=1330//lunch end time
    var lunchOnOff="Yes";  
     
       var 
    fp14 = new FunctionParameter("lunchOnOff"FunctionParameter.STRING);
        
    fp14.setName("showlunch");
        
    fp14.addOption("Yes");    fp14.addOption("No");    fp14.setDefault("Yes");
     
       var 
    fp15 = new FunctionParameter("lsTime"FunctionParameter.NUMBER);
        
    fp15.setName("lsTime");    /*fp15.setLowerLimit(0000);*/    fp15.setDefault(1130);
       var 
    fp16 = new FunctionParameter("leTime"FunctionParameter.NUMBER);
        
    fp16.setName("leTime");    /*fp16.setLowerLimit(0000);*/    fp16.setDefault(1330);
     
    //Lunch stuff
    if(mktTime>=lsTime && mktTime leTime && lunchOnOff=="Yes"){
         
    setBarFgColor(Color.RGB(94126100));}
    //end lunch stuff 

  • #2
    rangers
    The enclosed revision (here set up as a complete efs) should do what you asked
    Alex

    PHP Code:
    function preMain(){

        
    setPriceStudy(true)
     
       var 
    fp14 = new FunctionParameter("lunchOnOff"FunctionParameter.STRING);
        
    fp14.setName("showlunch");
        
    fp14.addOption("Yes");    fp14.addOption("No");    fp14.setDefault("Yes");
     
       var 
    fp15 = new FunctionParameter("lsTime"FunctionParameter.NUMBER);
        
    fp15.setName("lsTime");    /*fp15.setLowerLimit(0000);*/    fp15.setDefault(1130);
       var 
    fp16 = new FunctionParameter("leTime"FunctionParameter.NUMBER);
        
    fp16.setName("leTime");    /*fp16.setLowerLimit(0000);*/    fp16.setDefault(1330);
        
    }

    function 
    main(lunchOnOff,lsTime,leTime){
     
    var 
    mktTime = (getHour()*100)+getMinute();

    if(
    mktTime>=lsTime && mktTime leTime && lunchOnOff=="Yes"){
         
    setBarBgColor(Color.RGB(94126100));}

    return;

    Comment


    • #3
      Alexis, thank you so much. Response in 10 minutes and works like a charm of course. I integrated this into my existing EFS. Perfect. Trying to work through a transition from Easy Language to EFS code. Thanks.

      Comment


      • #4
        Time Color.efs

        Rangers:
        I tried to find the original thread this efs come from, but I had no luck. I have attached an efs created by Alex called timecolor.efs.
        Alex coded this to highlight my opinion of the most profitable times to trade the S&P.
        The green area is from 8:30 to 10:30 CST - morning trade
        The yellow is lunch - 10:30 to 1:30 PM CST
        The green is the PM trade 1:30 to 2:45 CST
        Red is the close 2:45 to 3:15 pm CST
        Try it to see if it is of any value to you.
        Harndog
        Attached Files
        Last edited by Harndog; 03-18-2004, 02:48 PM.

        Comment


        • #5
          I like it. Makes sense in order keep focus each day to different time frames. I guess ideally it would be great to display text in each section centered that says "Lunch" "PM" or whatever and provide in the edit studies inputs choice from time frames and color options.

          Believe it or not I have not figured out how to get a study to display in a certain order vertically or on the chart itself. New to eSignal. In Tradestation is it an option on each indicator. Having it below is an interesting idea too though. Thanks.

          Comment


          • #6
            rangers
            If you want the return to be displayed in the price window use setPriceStudy(true); in preMain()
            The order in which the study windows are displayed depends on the sequence in which they were loaded (topmost is the first loaded). However, you can alter their positions by clicking and dragging the study panes while keeping the <Ctrl> key pressed.
            Hope this helps
            Alex

            Comment

            Working...
            X