Help on a simple reversal thinkscript

G

gregoryK

New member
VIP
new to coding so this may be very simple, but I'm trying to create a reversal scan that tells me when price hits the 34EMA (touches or crosses) and then crosses back up to cross the 8EMA. Not the EMAs crossing but the price bars (on the 15, but obviously the code will work on any time frame). It would also be nice, if possible if I could have it alert if the price comes NEAR the 34EMA - though I don't know how you'd do that. Once I create that scan I'd like to put it in my watchlist with a color indicator to alert me when this activity has occurred.

As for PUTs, I think the inverse would be when price touches the 8EMA then falls below the 34.

If I'm asking something that's already been done, and you don't mind sending me a link, I'd appreciate it and if this isn't clear, I'm happy to qualify. I know in TOS you can set a scan for these activities individually I'm just not sure how to do it for a sequence of activities.
 
BenTen

BenTen

Administrative
Staff
VIP
Can you show a chart of the scenario you mentioned?
 
G

gregoryK

New member
VIP
sure I'll show 2:

the 34 is the blue line and the 8 is the dotted yellow:

here is LVS on the 15 from today:

hmmm....I'm embarrassed to say I have no idea how to import an image into here. it's asking for a link but these are shots I put on the desktop. can you tell me how to import a screenshot into this thread?

well didn't know how to do it...but this seems like a method, though it's not embedded - apologies.

this is LVS and you'll see the stock hit the 34 EMA then bounced up and crossed the 8, this is potentially a sign of a reversal for the day



another example:

SWN same thing as the 2nd and 3rd bar on the 15 SWN crossed the 34 (touching or crossing is fine) then it bounced up and through the 8EMA...and continued for the rest of the day



in both cases and many more I could include this is a nice indicator to see if a stock is potentially reversing.
 
Last edited by a moderator:
G

gregoryK

New member
VIP
an update to my request...I have tried something but can't quite make it work in terms of an alert on my watchlist. I'm new to thinkscript so ...be kind :) the idea is that I get an alert when a bar goes near the 34 (thus I used the 32) and then moves back up through the 8

def EMA32 = low crosses below ExpAverage(low(), 32) within 10 bars;
def EMA8 = close crosses above ExpAverage(low(), 8) within 5 bars;
plot signal = ema32 and ema8;
signal.AssignValueColor(if signal then Color.PLUM else Color.BLACK);

this does not work for a watchlist and any assistance would be greatly appreciated.
 
A

ajai

New member
VIP
You can develop a stock scan based on your criteria in TOS. Look for some tutorial on U tube.It would be easy to do if you are using TOS.
 
L

leonrossi

New member
an update to my request...I have tried something but can't quite make it work in terms of an alert on my watchlist. I'm new to thinkscript so ...be kind :) the idea is that I get an alert when a bar goes near the 34 (thus I used the 32) and then moves back up through the 8

def EMA32 = low crosses below ExpAverage(low(), 32) within 10 bars;
def EMA8 = close crosses above ExpAverage(low(), 8) within 5 bars;
plot signal = ema32 and ema8;
signal.AssignValueColor(if signal then Color.PLUM else Color.BLACK);

this does not work for a watchlist and any assistance would be greatly appreciated.
Hi All,
i'm new to thinkscript as well. I have tried to do this in TOS as well but i do get false breakouts. what i would like is to see is a stock in an uptrend or downtrend for about 2 weeks first before they cross over. Does anyone know how to do this?

Regards,
LeonRossi
 

Similar threads

Top