Announcement

Collapse
No announcement yet.

LSMA angle

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

  • LSMA angle

    I use Woodie's layout for esignal. In his layout, it displays the angle of the 34 ema. Is there any way to have the angle of the lsma displayed? In making trades, I like an lsma with good slope and sometimes it is easy to see, but it would be very useful if there was a way to have the actual slope displayed like it is for the 34 ema. Thanks in advance.

  • #2
    Hi,

    I started out in Woodies Room and still subscribe to many of the trading philosophies including Traders helping Traders.

    To this end I created an EFS file that uses his LSMA, displays the current angle in the top right hand corner of the screen and changes the colour of the line according to the angle which the LSMA is at.

    In edit studies you can configure the Up/Down thresholds and you need to use the multiplier function in Edit Studies in order to get it working properly (ie. set it to 1000 for the Euro).

    Its not perfect because I am not a programmer, but it may help you solve your problem that frankly it took me weeks to resolve myself.

    Its attached.

    Please feel free to share it with anybody in Woodies room, its nice to give something back every once in a while.
    Attached Files

    Comment


    • #3
      lsma

      Thanks i will check it out..sounds great

      woodie

      Comment


      • #4
        rogerha- Thanks for the efs file. How would I change to 15 lsma from the 25? I went to edit studies, but the value did not change when I changed the 25 to 15 and -25 to -15. Also, when I looked at todays ym 3min chart, it ends with slope of -112. This obviously isnt correct s should it be 112-90= -22 degree slope?

        Comment


        • #5
          I think there ma have been a simpler method....

          define var vLinReg = new LinearRegressionStudy("HLC/3", 20, 1);

          then retreive

          LinearRegValue=vLinReg.getValue(LinearRegressionSt udy.BASIS, 0)
          OldLinearRegValue=vLinReg.getValue(LinearRegressio nStudy.BASIS, -1)

          then continue with

          var slope = (LinearRegValue - OldLinearRegValue ) * 1;

          All the math is done for you by eSignal.

          Comment


          • #6
            I'm sorry, but I am clueless on how to use this. Is there any way to post as an attatchment like the previous one so I can just download into the formulas of esignal?

            Comment


            • #7
              ****elly, you need to change the nLength not the thresholds. Thats said I never used it on the YM so I cannot vouch for its success there.

              As I said I am not a programmer at all, the reason I posted it was I can get it working on the Euro or the Russell by tweaking the Multiplier. When I coded it, I was having problems with the varying Decimal Point's that different contracts have.

              Fundamentally though the process works, hopefully somebody in this forum can hlp you with the refinement of it.

              Sorry I can't be much more help, but it does help you along the way.

              Perhaps DLoomis can improve the script, he seems to know what he is talking about.

              Comment


              • #8
                Here's a leaner version with DLoomis suggestion, thanks DLoomis, any help with the decimal point issue ?
                Attached Files

                Comment


                • #9
                  I was confused by the multipier factor.

                  Can you tell me why you needed it?

                  Is it because you want the value of slope to be a number between 0 and 1 so Math.atan(slope) works?

                  Comment


                  • #10
                    Rogerha

                    sym=getSymbol().substring(0,2);
                    Multi=Math.pow(10,2);//this covers everything but the following
                    if(sym=="6E")Multi=Math.pow(10,4);//euro
                    if(sym=="ES")Multi=Math.pow(10,2);/s&p mini
                    if(sym=="YM")Multi=Math.pow(10,0);//dow30
                    if(sym=="AB")Multi=Math.pow(10,2);//russell
                    if(sym=="NQ")Multi=Math.pow(10,1);//nasdaq

                    is a suggestion on how you could have the efs calculate Multi and avoid user confusion with Edit Studies.

                    Comment


                    • #11
                      Thanks David, I could have made use of your knowledge many weeks ago

                      It was different symbols having different price formats that caused me problems.

                      Attached is a version which *should* work on most markets.

                      I haven't time to test it myself right now, so see how it goes.
                      Attached Files

                      Comment


                      • #12
                        Roger

                        You really seem into this, so here are few more suggestions.

                        You don't want to run the multi calcs every tick, once is enuf. Saves the cpu for other tasks.

                        // define var once=null before main()

                        if(once==null){

                        sym=getSymbol().substring(0,2);
                        Multi=Math.pow(10,2); //this covers everything but the following
                        if(sym=="6E")Multi=Math.pow(10,4);//euro
                        if(sym=="ES")Multi=Math.pow(10,2);//s&p mini
                        if(sym=="YM")Multi=Math.pow(10,0);//dow30
                        if(sym=="AB")Multi=Math.pow(10,2);//russell
                        if(sym=="NQ")Multi=Math.pow(10,1);//nasdaq

                        once="enuf"
                        }

                        Also /* and */ enclose comments - works great for commenting multiple lines at once.

                        Comment


                        • #13
                          Also, the following link regarding the atan problen



                          says if the angle is in qudrant 2, ie your efs gives a negative result, you are supposed to add 360 degrees to the result to get angle B.

                          However, you seem to want the value of the angle 90-B, so take the above result and subtract from 90.

                          This may be the solution to the issue ****elly had with the -112 angle which didnt look right.

                          My trig is lousy, but I think I have it right.

                          PS - Quadrant 3 and 4 should not be a concern, except in very unusual market activity

                          Comment


                          • #14
                            David,

                            Yes I have been 'trying' to do this for a while, I had never done any programming before this !

                            I am working on another product at the moment, it was just this particular indicator was a pre-cursor do the project I am 'attempting' currently. I just thought it would be nice to share the work I had done thus far with Woodies group, since if it wasn't for Woodie I wouldn't understand the merits of LSMA

                            Attached is the 'once only' version for everybody, still untested.

                            David, you would probably be quite interested in the other project ;-)
                            Attached Files

                            Comment


                            • #15
                              docs

                              looking for
                              WoodieCCI Software Installation and Use.doc

                              to download BUT get lost in this maze of files ....would some one post the
                              URL of this doc

                              many thanks ( been browsing for the last 2 hours !!!)

                              Comment

                              Working...
                              X