Announcement

Collapse
No announcement yet.

Rafter Movtrend

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

  • Rafter Movtrend

    Hi

    I'm looking for the following: if close of the bar < Rafter(18) movtrend color the bar red/if close of the bar >Rafter(18) movtrend color the bar navy.
    http://www.tssupport.com/support/bas...rticle&id=1803
    Thanks, Markus

  • #2
    Markus,

    I would suggest referring to my reply to a similar request of yours. The general concept is similar to this request, and need only be ported to TS Support's code.

    Also, I have moved this thread to the New Study Suggestions forum as it is more appropriate there, and adheres to our Custom Study Guidelines.
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      Re: Reply to post 'Rafter Movtrend'

      Hello JayF
      Thank you for your answer. I tried hard but it doesn't work. Here is my
      study; what is wrong with it?

      /************************************************** *******
      RafterCrossbar
      ************************************************** ********/

      function preMain() {
      setPriceStudy(true);
      setStudyTitle("Movtrend Cross");
      setCursorLabelName("Movtrend", 0);
      setDefaultBarFgColor(Color.blue, 0);
      setDefaultBarThickness(1,0);
      }

      function main(n) {
      if(n == null)
      n = 20;
      var sum = 0;
      var i = 0;
      var mt = 0;

      for(i = n; i > 0; i--)
      sum += (i - (n + 1) / 3) * close(i - n);
      wt = 6 / (n * (n + 1)) * sum
      return wt;

      if (C > Movtrend) {
      setPriceBarColor(Color.navy);
      } else if (C < Movtrend) {
      setPriceBarColor(Color.red);
      } else setPriceBarColor(Color.black);

      return MA;
      }



      ----- Original Message -----
      From: <[email protected]>
      To: <[email protected]>
      Sent: Friday, August 29, 2003 7:33 PM
      Subject: Reply to post 'Rafter Movtrend'


      > Hello mlauber,
      >
      > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      >

      Comment


      • #4
        Markus
        Here is your formula with a few revisions and comments to illustrate the construct.
        Alex

        PHP Code:
        function preMain() {
            
        setPriceStudy(true);
            
        setStudyTitle("Movtrend Cross");
            
        setCursorLabelName("Movtrend"0);
            
        setDefaultBarFgColor(Color.blue0);
            
        setDefaultBarThickness(1,0);
            
        setColorPriceBars(true);//this needs to be added to instruct the study to paint the bars

        }

        function 
        main(n) {
         if(
        == null)
          
        20;
         var 
        sum 0;
         var 
        0;
         var 
        mt 0;

         for(
        n0i--)
          
        sum += (- (1) / 3) * close(n);
         
        wt / (* (1)) * sum
         
         
        //wt is the Movtrend that is plotted via the return wt; found below
         
            
        if (close()>wt//if close(this bar) is greater than wt then
            
        setPriceBarColor(Color.navy);
            else if (
        close()<wt//else if close(this bar) is less than wt then
            
        setPriceBarColor(Color.red);
            else if (
        1==1//else in any other case if 1 is equal to 1 (which is always true) then
            
        setPriceBarColor(Color.black);
         
         return 
        wt
         } 
        Last edited by ACM; 08-29-2003, 03:10 PM.

        Comment

        Working...
        X