Announcement

Collapse
No announcement yet.

Parabolic Study

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

  • Parabolic Study

    Is it possible to use the previous bar's Parablic SAR study value as a doLong or doShort entry point? If so, how?

  • #2
    JSteensma
    See the example shown in this thread which was created using the Formula Wizard
    Alex

    Comment


    • #3
      JSteensma
      Following up on my previous reply.
      In addition to what is shown in the example I indicated you may want to include some conditions to check that the Open of the bar that breaches the value of the Parabolic at the prior bar is actually below (if entering a long trade) or above (if entering a short) that value. In that case you would use the value of the Parabolic at the prior bar as the entry price as shown in the example. If instead the Open was above (for a long) or below (for a short) you would then use the Open as the entry price (ie Strategy.MARKET).
      These additional conditions would ensure that the results of a backtest are realistic in those instances where a bar does not actually cross the Parabolic but gaps above/below it.
      Alex

      Comment


      • #4
        Thanks heaps for that Alex, it really helped. I allmost had it. I was trying to do it with a "Limit" rather than a "Stop" and I had not used -1 at the end of the SAR thing.

        I'm Just wondering if it's possible to remove the First trade or Two from the Back Test? the first trade seems to enter at 0.00. The first 2 or 3 moves on the SAR are not usually very accurate anyway. Also I'm finding that the SAR seems to do this big Arch from 0.00 to the first flip. It only happen when I bring up a new chart, the one that loads on starting up of eSignal is fine. Is there a way around this?

        Thanks agian for the help.

        Jason
        Last edited by JSteensma; 04-27-2006, 06:00 AM.

        Comment


        • #5
          Jason

          I'm Just wondering if it's possible to remove the First trade or Two from the Back Test? the first trade seems to enter at 0.00. The first 2 or 3 moves on the SAR are not usually very accurate anyway
          It depends. If you are using the Formula Wizard only then it is not possible because you need to create a global variable which the Formula Wizard cannot do
          If instead you are using the Editor then you would first create a global variable called for example Counter which you set initially to 0 as follows
          PHP Code:
          var Counter 0
          Then in main you create your Parabolic study as required
          PHP Code:
          var study sar(0.02,0.02,0.2); 
          At this point you create a condition that looks for Parabolic to reverse either way and each time that occurrs you increase the value of Counter by 1. Following that you create another condition that checks if Counter is less than or equal to 3 (or any number of initial trades you wish to discard) in which case you return null.
          PHP Code:
          if(study.getValue(-1)<low(-1)&&study.getValue(0)>high(0)||
             
          study.getValue(-1)>high(-1)&&study.getValue(0)<low(0)){
                  
          Counter++;
          }
          if(
          Counter <= 3) return (null); 
          Besides not allowing any trades prior to the number of reversals that you have defined this last condition also prevents the display of the arch you are referring to.
          Once you have done all the above you can now set you normal conditions for trade entries
          Hope this helps
          Alex

          Comment


          • #6
            Thanks Alex, That's working like a charm. Now I can start adding to that. Cheers mate

            Jason

            Comment


            • #7
              Jason
              You are most welcome
              Alex

              Comment

              Working...
              X