I tried. Nothing happened.
I'll try to write the code from scratch
I'll try to write the code from scratch
I liked your video! I have been trading a long time and could not of said it better!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:
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);
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.@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.
|Thread starter||Similar threads||Forum||Replies||Date|
|Z||Ensure exit is not on same candle as the entry, also trading hours?||Questions||0|
|R||Static value at the time of Entry Price||Questions||1|
|I||Bollinger Band entry code||Questions||0|
|E||Get EntryPrice() in Lower Indicator Floating PL||Questions||1|
|Three Different ADSPD Adv/Dec Codes to Try Out||Indicators||34|