Need someone help write this code for ThinkorSwim

fyzh

New member
VIP
Here's code for double MA (EMA and SMA) system. Great indicator for trend! If some can understand the code and write a script for TOS, that would be great!

Code:
MA20:MA(C,20),DOTLINE,COLORRED;
MA60:MA(C,60),DOTLINE,COLORBLUE;
MA120:MA(C,120),DOTLINE,COLORYELLOW;
EMA20:EMA(C,20),COLORRED;
EMA60:EMA(C,60),COLORBLUE;
EMA120:EMA(C,120),COLORYELLOW;
STICKLINE(C<EMA20 AND MA20<REFV(MA20,1),O,C,0.8,0),COLORGREEN;
STICKLINE(C<EMA20 AND MA20<REFV(MA20,1),H,L,0.001,0),COLORGREEN;
STICKLINE(C>EMA20 AND MA20>REFV(MA20,1),O,C,0.8,0),COLORRED;
STICKLINE(C>EMA20 AND MA20>REFV(MA20,1),H,L,0.001,0),COLORRED;
STICKLINE(NOT ((C<EMA20 AND MA20<REFV(MA20,1)) OR (C>EMA20 AND MA20>REFV(MA20,1))),O,C,0.8,0),COLORGRAY;
STICKLINE(NOT ((C<EMA20 AND MA20<REFV(MA20,1)) OR (C>EMA20 AND MA20>REFV(MA20,1))),H,L,0.001,0),COLORGRAY;
STICKLINE(CROSS(EMA20,MA20)=1,O,C,0.8,0),COLORBLACK;
STICKLINE(CROSS(EMA20,MA20)=1,H,L,0.001,0),COLORBLACK;
STICKLINE(CROSS(MA20,EMA20)=1,O,C,0.8,0),COLORYELLOW;
STICKLINE(CROSS(MA20,EMA20)=1,H,L,0.001,0),COLORYELLOW;
STICKLINE(CROSS(EMA20,EMA60)=1,O,C,0.8,0),COLORMAGENTA;
STICKLINE(CROSS(EMA20,EMA60)=1,H,L,0.001,0),COLORMAGENTA;
STICKLINE(CROSS(EMA60,EMA20)=1,O,C,0.8,0),COLORBLUE;
STICKLINE(CROSS(EMA60,EMA20)=1,H,L,0.001,0),COLORBLUE;
DRAWNUMBER(CURRBARSCOUNT=21,H,C),COLORBLACK;
DRAWNUMBER(CURRBARSCOUNT=61,H,C),COLORBLACK;
DRAWNUMBER(CURRBARSCOUNT=121,H,C),COLORBLACK;

If some can understand the code and write a script for TOS, that would be great!

J1ByrMM.png
 
Last edited by a moderator:

rad14733

Well-known member
VIP
I did. But I didn't found one like this!
But could one of them be adapted rather than someone having to convert the one in your first post...??? Just as you may not know Thinkscript we don't all know all of the other scripting languages either... What, specifically, do you find lacking...???
 

XeoNoX

Well-known member
VIP
looks like just a bunch of EMAs and SMAs, you can plot those with TOS... what else does that study do? if you define what it does maybe someone can write the code.
 

Similar threads

Top