MTF Last Month's High, Low, Close

traderjoe777

New member
VIP
Based on Saty Mahajan's Golden Gate Strategy, I am trying to create a scanner (Simplified version below) (let's call it golden_gate_scanner) which relies on 4 things, "high", "low", "close" of last month and close price today (or 1 day before). Below is the algorithm.
  1. Based on the previous months high, low & close. We calculate the ATR value (Wilders) say atr.
  2. Using this expression (previous_month_close + (atr * 0.382)) we get a value, say upper_trigger
  3. Plot the upper_trigger & if today's close crosses it then the ticker should appear in our scan/watchlist.
I have coded the above logic & have added a filter with the following condition on ToS scan tab.
  1. close is greater than or equal to golden_gate_scanner()."upper_trigger" with the aggregation period of "D".
As thinkorswim cannot aggregation 2 different periods (Month and Day in this case), Is there a way we can create a scan for this scenario? I believe we can because Saty's website indicates that it exists. Any inputs are highly appreciated.
Thank you.

Ruby:
input use_current_close = no;
input atr_length = 14;

def trading_period = AggregationPeriod.MONTH;

def previous_close = close(period = trading_period)[if use_current_close then 0 else 1];
def atr = Round(WildersAverage(TrueRange(high(period = trading_period), close(period = trading_period), low(period = trading_period)), atr_length)[if use_current_close then 0 else 1], 2);

def upper_0382 = previous_close + (atr * 0.382);

plot upper_trigger = upper_0382;

 

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

Thread starter Similar threads Forum Replies Date
B show only last period of MTF MA Questions 2
R Repaints MTF Awesome Oscillator For ThinkOrSwim Questions 8
T MTF Awesome Questions 0
I MTF Average Daily Close Line Questions 2
D MTF Stoch Signals Questions 0

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
389 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