in Search

Monthly Pivots

Last post 11-22-2005, 23:02 by brownsfan019. 3 replies.
Sort Posts: Previous Next
  •  10-17-2005, 22:22 9865

    • Vanez is not online. Last active: 07/31/2006, 9:47 Vanez
    • Not Ranked
    • Joined on 10-17-2005
    • Byron Bay > NSW > Australia
    • Posts 1

    Monthly Pivots

    Hey all.
    Just letting you know that I just purchased MS last night... so I'm real new to this.

    I have this EXEL Spreadsheet that calculates Support And Resistance Lines. I used to have Incredible Charts, and I used to manually put in the values (as Horizontal Lines on the chart) the spreadsheet gave me, which was very painful.
    Then I found out the potential power of MS! I was wondering if it was possible to write an indicator/system that could do my spreadsheets calculation and my manual labour automatically!

    I've been looking around the site's forums for people with similar questions, but i believe that my question is on a commonly asked question, it just has a little twist that no one else has specifically asked.

    This is what I used to do:

    1. Set my chart to monthly
    2. Write down the PREVIOUS month's High Low and Close
    3. Plug the previous month's H L and C into the spreadsheet.
    4. The spreadsheet had this formula in itself:

    H= Previous Month's High
    L= Previous Month's Low
    C= Previous Month's Close

    Pivot =(H+L+C)/3

    R1 =2*P-L
    R2 =(P-S1)+R1
    R3 =2*P+(H-2*L)

    S1 =2*P-H
    S2 =P*(R2-S1)
    S3 =(2*P)-(2*H-L)

    With R1 being Resistance Line 1 and so on...
    and S1 being Support Line 1 and so on...


    5. I'd then note the values it then calculated
    6. Then I'd manually place a Horizontal Lines on the values I noted from the spreadsheets.
    7. I'd then repeat steps 1-6 for every stock in my watch list!! (See what I mean :( )

    Basically I'd do this every month to get an idea where all the Support and Resistance Lines are at, and when I apply the indicator/system, horizontal lines pop up on the chart, which satisfy the above formula.

    Question:
    Is it possible to design a code that does the above procedures automatically?
    If so, can you give me a look at what the code would look like? (If you solve this you will be known as a champion knight in my books :D )
    If not, can you give me some tips that might enable me to achieve my goal?

    Thanks for reading my plea.
    Hope someone can give me feedback.

    Love always,
    Vanez
  •  10-18-2005, 1:26 9871 in reply to 9865

    Re: Support/Resisatnce For a Newb

    Vanez:
    S2 =P*(R2-S1)

    Perhaps this pivot should be something like S2= (P-R1)+S1 instead.


    Vanez:
    Love always,
    Vanez

    Unfortunately Love doesn't pay the bills. :?
    But since we've been asked to be nice to Newbies...

    MetaStock -> Tools -> Indicator Builder -> New ->
    Copy and paste indicator formula.

    Code:

    { Monthly pivots v2.0 }

    { ©Copyright 2002~2005 Jose Silva
    For personal use only.
    http://www.metastocktools.com }

    { Message }
    message:=Input("plot on Weekly/Daily/Intraday charts",0,0,0);

    { Month's start }
    mthStart:=Month()<>Ref(Month(),-1);

    { Previous Month's High }
    Hi:=HighestSince(1,mthStart,H);
    mHi:=ValueWhen(1,mthStart,Ref(Hi,-1));
    mHi:=ValueWhen(1,mHi>0,mHi);

    { Previous Month's Low }
    Lo:=LowestSince(1,mthStart,L);
    mLo:=ValueWhen(1,mthStart,Ref(Lo,-1));
    mLo:=ValueWhen(1,mLo>0,mLo);

    { Previous Month's Close }
    mCl:=ValueWhen(1,mthStart,Ref(C,-1));
    mCl:=ValueWhen(1,mCl>0,mCl);

    { Pivot }
    pivot:=(mHi+mLo+mCl)/3;

    { Support & Resistance }
    R1:=2*pivot-mLo;
    S1:=2*pivot-mHi;
    R2:=(pivot-S1)+R1;
    S2:=(pivot-R1)+S1;
    R3:=2*pivot+(mHi-2*mLo);
    S3:=2*pivot-(2*mHi-mLo);

    { Plot pivots on chart }
    R3;R2;R1;
    pivot;
    S1;S2;S3




    jose '-)

    MetaStockTools.com
    .
    MetaStockTools.com
  •  11-18-2005, 3:41 11531 in reply to 9865

    Re: Re: Support/Resisatnce For a Newb

    Jose Another newbie sends his love (and appreciation!) :)
  •  11-22-2005, 23:02 11736 in reply to 9865

    Re: Re: Support/Resisatnce For a Newb

    Jose,
    Thanks for the posting the monthly pivots too! I came back to ask for that, and there it was.
View as RSS news feed in XML