Fedegrosso
New member
I tried. Nothing happened.
I'll try to write the code from scratch
I'll try to write the code from scratch
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);
@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.
Perhaps I don’t understand. I don’t see the code for “my indicator”.@adefrenza If Ninjatrader has an exponential moving average then you have it already. Just apply the strategy.
@madeinnyc: I am using a 1 minute chart.
@zee2881: Thanks for the info. I will dig into that further.
@stockminion: I created this video for you and anyone else interested in learning how to do this.
@BenTen: Still learning how to use this site. Sorry for the improper post tags, etc.
/NQ trading video: https://www.dropbox.com/s/liql6pl1vmrcd53/NQ_Strategy.mp4?dl=0
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
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.
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.