Announcement

Collapse
No announcement yet.

Is Esignal capable of this?

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

  • #16
    Hello cv989,

    Based on the information and code you have posted, it does not appear that you have read through the Guide to Developing EFS Indicators. If you are truly committed to learning EFS you should review this guide to gain an understanding of the EFS basics.

    By the way, the formula you attached did not contain the code snippet you posted earlier today. If you put that code snippet inside main() and make the study a price study, you would get the result similar to the image I previously posted.

    In the formula you just attached, the first thing you need to do is add the preMain() function and make the study a price study so that the circles will be drawn on the price window instead of the indicator pane. Add the following to the top of your study.



    Next, add the following routine to the top of main(). This code block simply increments your image counters by a value of 1. The Friday counter increments at each new bar and the monthly counter increments at each new month. These counter variables will be used to create your unique tag names for the drawShapeRelative() calls.



    Next, add the code snippet you posted earlier today for the Friday circles.



    For the monthly circles, add the following code block. This is the same as what you had in your attached formula. I just moved the logic for incrementing the monthly counter to the top of main. Also, you can remove the last drawShapeRelative() call in your attached study. It was drawing a circle on every bar, which is not what you want.



    After you make these changes, you should see something like in the chart below.



    If you continue to have trouble getting the formula to work, attach your latest version of the code and I'll provide additional guidance.
    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


    • #17
      JasonK -
      That EFS stufy I posted was incorrect, I kept all the individual code sets in files so that if I ever want to reuse them I can just easily refer to the ones I have for future use. sorry for bothing you with that one...

      I have checked the one I have vs the one you just posted. Everything I had was very similar, except the monthly circles which you explained in your post. I understand why its moved to
      function Main()

      Anyway....When I perform a syntax check, It appears I am missing some code perhaps? The error I get is:
      "syntaxError:
      missing } in compound statement:
      }"

      Even though I have a "}" in the code.


      I've posted it here as well:

      function preMain() {
      setPriceStudy(true);
      setStudyTitle("Circles");
      setShowCursorLabel(false);
      }

      var nFridayCntr = 0;
      var nMonthlyCntr = 0;

      function main() {
      if (getBarState() == BARSTATE_NEWBAR) {
      nFridayCntr += 1;
      if (month(0) != month(-1)) {
      nMonthlyCntr += 1;
      }
      }

      var dBarDate = getValue("time");
      if (dBarDate.getDay() == 5) {
      drawShapeRelative(0, close(0), Shape.CIRCLE, null, Color.blue, Shape.ONTOP, "Friday"+nFridayCntr);
      {


      if (month(0) != month(-1)) {
      drawShapeRelative(-1, close(0), Shape.CIRCLE, null, Color.yellow, Shape.ONTOP, "Month"+nMonthlyCntr);
      }
      return;

      }
      Last edited by cv989; 12-14-2005, 05:45 AM.

      Comment


      • #18
        EFS Attached
        Attached Files

        Comment


        • #19
          cv989
          In line 21 you have an open bracket { instead of a close bracket }
          Alex

          Comment


          • #20
            Darn...
            I was staring at this for some time... and now I see it...
            Got it working!!
            Very happy...

            I just need to get the monthly closing prices to go over the close vs as they are now..
            Attached Files

            Comment


            • #21
              Hello cv989,

              You are drawing the monthly circle on the right bar, but you are using the close(0) value from the first bar of the month. That happens to be the bar that is being processed by your formula when the end of the month is detected. All you need to do is use the close(-1) value when drawing the monthly circle instead of close(0).

              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

              Working...
              X