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.
Announcement
Collapse
No announcement yet.
LSMA angle
Collapse
X
-
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
-
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
-
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
-
****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
-
Here's a leaner version with DLoomis suggestion, thanks DLoomis, any help with the decimal point issue ?Attached Files
Comment
-
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
-
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
-
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
-
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
-
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
Comment