Storing Intraday Crossover Data From Previous Days in a Watchlist

craigjjmorrison

New member
VIP
I want to compare various potential exit points for positions from previous days. For instance, I would like to know the price at which a stock first crossed below a moving average, such as SMA 10, in each of the past 4 trading days. I would also want the same for an exponential moving average. Ideally, I could store the SMA in one 5-minute column and the EMA in another. To collect history, I would update and export the watchlist for each of the ten days.

I can collect this data for the current day, but I'm unable to retrieve data from previous days using:
Code:
Def OpeningBell = 930;
Def ClosingBell = 1600;
Def FloorIsOpen = SecondsFromTime(OpeningBell) >= 0 and SecondsTill(ClosingBell) >=0;
Def SMA10 = SimpleMovingAvg(Close,10);
Def XOver= if !FloorIsOpen then 0 else if XOver[1] == 0 and Crosses(Close,SMA10,CrossingDirection.below) then Close else XOver[1];
Plot X = XOver;

If today were Friday, I would like to use the watchlist to separately collect Mon, Tues, Wed, and Thurs.
 
Solution
I want to compare various potential exit points for positions from previous days. For instance, I would like to know the price at which a stock first crossed below a moving average, such as SMA 10, in each of the past 4 trading days. I would also want the same for an exponential moving average. Ideally, I could store the SMA in one 5-minute column and the EMA in another. To collect history, I would update and export the watchlist for each of the ten days.

I can collect this data for the current day, but I'm unable to retrieve data from previous days using:
Code:
Def OpeningBell = 930;
Def ClosingBell = 1600;
Def FloorIsOpen = SecondsFromTime(OpeningBell) >= 0 and SecondsTill(ClosingBell) >=0;
Def SMA10 = SimpleMovingAvg(Close,10);
Def...
I want to compare various potential exit points for positions from previous days. For instance, I would like to know the price at which a stock first crossed below a moving average, such as SMA 10, in each of the past 4 trading days. I would also want the same for an exponential moving average. Ideally, I could store the SMA in one 5-minute column and the EMA in another. To collect history, I would update and export the watchlist for each of the ten days.

I can collect this data for the current day, but I'm unable to retrieve data from previous days using:
Code:
Def OpeningBell = 930;
Def ClosingBell = 1600;
Def FloorIsOpen = SecondsFromTime(OpeningBell) >= 0 and SecondsTill(ClosingBell) >=0;
Def SMA10 = SimpleMovingAvg(Close,10);
Def XOver= if !FloorIsOpen then 0 else if XOver[1] == 0 and Crosses(Close,SMA10,CrossingDirection.below) then Close else XOver[1];
Plot X = XOver;

If today were Friday, I would like to use the watchlist to separately collect Mon, Tues, Wed, and Thurs.
Would you be interested in something like this>
Strategy (Best)- This is where it gets interesting.

Example:

Entry:
A+ CALL

Exit Method A:
5m SMA10

Exit Method B:
15m EMA20

Exit Method C:
VWAP

Exit Method D:
Structure Breakdown

Exit Method E:
V6 Trade Grade downgrade

Now ThinkOrSwim produces results like

Trades = 127
Win Rate
Average Win
Average Loss
Profit Factor
Expectancy
Net Profit
Drawdown

for EACH exit method. What I'd want to build keep your entry fixed.

Example:

A+ CALL
or
A+ PUT from Script Institution Market Structure V6. Then create 5 versions:

Version 1 = Exit = 5m SMA10 Cross

Version 2 = Exit = 5m EMA20 Cross

Version 3 = Exit = 15m EMA20 Cross

Version 4 = Exit = Close below VWAP

Version 5 = Exit = Structure Score < 50

Then compare reports. (5 different strategies)

A "Multi-Exit Analyzer Strategy."

One entry. Five exit methods. One report.

At the end it tells you for example:

SMA5
Profit Factor = 1.8X

SMA10
Profit Factor = 1.4X

EMA20
Profit Factor = 1.9X

VWAP
Profit Factor = 1.7X

Structure
Profit Factor = 2.3X

Then you stop guessing and let the data tell you how to manage trades.

This is probably the highest-value research project you could do next. The biggest gains are no longer coming from finding better entries, they're coming from finding the exit method that extracts the most from the entries you're already taking.

This way you can back test multiple exits based off almost any trigger that can be coded. Pretty cool.
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
901 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top