Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Need ideas for how to implement a “line in the sand†strategy.
In a nutshell, if I were to draw a horizontal line on my chart, I would like to be long above the line, and short below it. I’d like to code up an automated strategy to run in NT8 on ES and NQ.
I’m looking for suggestions how to best accomplish my goal without getting chopped to death in sideways markets.
A few initial ideas off the top of my head:
1. Use a moving average of some sort, and only reverse position when the MA crosses the line.
2. Use a renko brick, placed on the line. Go long at the top, short at the bottom.
3. Use some variation of an ORB box- long above the top line, short below the bottom line, etc.
Has anybody done anything like this?
My goal is to have something coded up for NT8 that I can backtest and optimize to lose as little as possible in the chop.
Can you help answer these questions from other members on NexusFi?
Are you primarily looking for help with the code or the idea of how to make something profitable?
I have general scaffolding of a strategy the just trades the open + or - some amount of tics, when a certain condition has occurred(Certain wick size then cross beyond the open price).
Other conditions are setting the # of entries allowed, along with setting up the WICK size for entry. Tried to explain it in the image. But HOW this one takes trades doesn't matter... point is that it pics a line and trades that line.
This one I made for FX, so it has a built in position sizer that sizes up to fix the risk based on the Entry-stop.
Note, that this is probably more than you want... but if you are interested in the code base to simply trade a line, this might be ok. Although if you already know how you want it built, than this may be of no use.
Thanks Forrestang. I'm primarily looking for ideas how to implement it and either make it profitable, or at least come as close as possible to breaking even. I would primarily use this to hedge short options straddles, so I always need to be long or short above or below the line. (although as a stand alone directional strategy, I'd like to backtest it to see if it has merit on its own)
You're running into a key conundrum for automated strategies based on technical analysis. Any kind of line you draw will run into situations where it gets crossed too often to be of any use. You can implement moving averages and other filters to reduce the number of signals, but then your entry will be slower. Some moving averages like a supersmoother try to reduce that lag, but that seems to just get you back to something break even.
My own conclusion has been that a successful automated trading strategy simply has to be more complicated than that.
Thanks for the feedback. Regarding your comment about moving averages and other filters, that's what I'm really looking for from other members of this forum- what are some ideas that I'm not considering to reduce the amount of signals/chop? So far I mentioned placing a renko bar (or box) on the line, and also mentioned moving averages. Are there any other methods I'm missing?
From a technical perspective other things you can look at are oscillators and candlestick patterns. I would avoid Renko bars as there's problems with backtesting them. Oscillators and candlesticks can help though because they spread out your signals. When an oscillator triggers it's unlikely to happen again for a set period of time. Candlestick patterns tend to give you a good distribution of trades in different types of action. From there it's a question of how many signals you get, and if you can filter them down. Doesn't necessarily mean it will bring edge though. I'm not saying the technical are useless, but they don't take you very far on their own.