Try this NQ Strategy + Code for ThinkorSwim

Hmmm.... really bazaar. Don't know enough about TOS troubleshooting to know what to check. Hopefully the manual route is the solution!
 
I've managed to write a simple one and it actually work. The code is:


input length = 20;
input price = close;
plot SMA = Average(price, length);
SMA.AssignValueColor(if close>=SMA then Color.Green else Color.Red);

Spending the weekend trying to automate the strategy
 
New here, so I thought I’d post something everyone can use (who wants to).

I’m normally not a very big fan of lagging indicators but this is super easy to use and gives pretty high win ratios in these markets. Plus, it’s VERY easy to get the hang of it!

I had this created for me a while back (see code below).

You simply wait for a bar/candle to close below/above the line and take a breakout/breakdown 1 tick above/below (depending on direction) the prior candle. (see annotations in screenshot)

Been getting 20 to over 100 points (points NOT ticks!) per trade!!

I annotated this in the screenshot, but to reiterate… loss mitigation is entirely up to you. Some of these candles are 40-90+ points in a single minute. So, use caution on how tight you keep things. Let the market breathe and the strategy do its thing! You can use the opposite end of the prior candle you are trading your breakout/breakdown from to protect capital. Or you can pretty much do whatever is inline with your risk tolerance.

Profit taking is a bit different – at least for how I handle it. I set an initial profit target 100 points above my entry (because these markets are NUTS!!). I’ve had this hit many times in 30 minutes or less. Especially that last one which took about 5 minutes (see Wednesday March 19, 2020 at 2:46 Chicago time short entry price 7395.25).

I use this on the NQ with a 1-minute chart and that’s about it. Super fun and easy to see in real-time.

Here is the code:
Code:
plot myindicator=ExpAverage(close,20);
myindicator.SetDefaultColor(Color.White);
myindicator.AssignValueColor(if close>=myindicator then Color.Green else Color.Red);
myindicator.SetStyle(curve.LONG_DASH);
myindicator.SetPaintingStrategy(paintingstrategy.LINE_VS_SQUARES);
myindicator.SetLineWeight(5);
myindicator.setHiding(if close>open(period="DAY") then 0 else 1);

riufzjW.jpg

I liked your video! I have been trading a long time and could not of said it better!
 
@Fedegrosso

Not sure if this will matter in the long run, but I put your code on my same chart and it is different from my version. Mostly matches but doesn't at times. Sometimes good, sometimes not good.

Indicator Comparison

@BenTen I must be doing something wrong with http://imgur.com/ Everytime I try to post the link it says there is an error. Could you send me to the instructions again? Saw it somewhere but could not find it. Sorry for the hassle! ¯\(ツ)
 
@Fedegrosso @AlgoTrader77 The plots are different because one is a Simple MA and one is an Exponential MA. That is all. Please try to understand how the indicators you use work. The difference of these two without getting into the calculations is the EMA weights recent prices more while the SMA weights all prices in the length the same. Thus the EMA will follow price more closely.
 
@zee2881 Thanks and no problem!

@Fedegrosso A limit order is what I use. In TOS it would be a "stoplimit" (sell for short, buy for long) since you are getting in on the breakout/breakdown. The key is to watch the color of the line turn from red to green and visa versa. There is no guessing where to get in because you instantly have your high or low price of the candle where it changes and you can simply place your stop entry order a tick above/below that candle. i.e. Above for long positions, below for short positions. Because you are placing a buy limit to go in that direction above price, it is called a stoplimit. (TOS coders can correct me)

Also @Fedegrosso and @zwarriortrader (and anyone else wanting to give this a go)

As far as the code, try this sequence:

1. Open a notepad doc.
2. Scroll up to the post that contains the code and copy and paste it into your doc. We'll come back to this in step 7 and 8.
3. In TOS, open any chart. I like the NQ using a 1 minute time frame.
4. Right click, hover over "studies" and select "edit studies" (you can also get there by clicking on the test tube looking icon at the top right of your chart).
5. Then click "Create".
6. This will open a work space you can paste the code into. Before you do that, delete the default line of code in there "plot Data = close;".
7. Go back to your notepad doc and highlight and copy the code.
8. Paste it into that work space.
9. At the very top you can name it whatever you want. The default is "NewStudy0". So just delete that and name this something you can remember.
10. Then click "ok" and go back to your chart and add it like you would any other indicator.

Let me know if that does the trick or if you have any other questions.

Algo, I love the simplicity of this indicator and strategy. You have named the indicator "myindicator" in the thinscript. Any chance you can share your code? I am super interested to see if it can be improved in any way and/or convert the code to Ninjatrader. Will obviously share any improvements with you.
 
Yo people....what @horserider is trying to say is, "If it looks like a duck, walks like a duck...then chances are....'IT'S A DUCK!'. Look under the hood at the source code and you'll find it's the exact same code as an 'Exponential MA'. This is hardly a strategy....it's more a colored line with basic logic! "Just trade the move above or below the 20EMA on the next bar when it changes color".....anyone with basics in trading could figure that out....but that doesn't make it a viable strategy.

This is not to burst anyone's hope of using this tool. But if you're gonna use it, be sure to combine it with other tools that address areas of consolidation/chop zones and provide confirmation of entry/exits. In concert with other tools, you can then develop a viable process.
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
165 Online
Create Post

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