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)
Attached, please find an automated strategy based on Donchian Channel
The strategy loses around $2000 a day and when reversed it loses around $4000 a day on TF 4-range chart with 10/10 tick target/stoploss
Can anyone take a look and suggest any changes to be made so that we can go against the reverse strategy at the same entry price +/- 1 tick so that instead of losing $4000 a day we can make even half that much
Please set T 51. UseDeltaStopLoss to False
I need to warn everybody against running this strategy or its reverse using real money as he will lose a lot of money for sure
Please let me know what you guys think
Thank you
Can you help answer these questions from other members on NexusFi?
If they do, then you will learn that this does not work.
You cannot take a losing strategy, reverse it, and turn it into a winning strategy. A losing strategy is a losing strategy.
If you kept every single trade identical, and just took the opposite position - fine. But that will never happen. And while you could program a backtest to do this, on historical data, it would never work going forward on live data/trading.
The reasons are many: slippage and news for one, and then a whole slew of psychological problems that exist even with automated strategies.
I am speaking from experience. I think every programmer that found a losing strategy probably tries to make it a winning strategy by reversing it.
Doesn't work. Instead, what ends up happening is you keep modifying the strategy, adding "filters" and so forth, until it's now overly curve fitted to historical data that has no bearing on the future market. This is where nearly all automated trading paths lead -- over curve fitting, and very few people truly understand it well enough to avoid it.
There are several good webinars on automated trading in the webinar section of futures.io (formerly BMT), including those by @kevinkdog, that are worth watching for a basic understanding of proper design and testing.
Hopefully others will give you their input as well.
I do hope someone will do as you ask. Just reverse the EnterLong with EnterShort and so forth, and you'll see it doesn't work.
You could "force" it only by keeping an exact entry/exit time for every trade, and programatically taking the opposite position. But that is worthless and only would show useful on a backtest.
The reason swapping EnterLong and EnterShort doesn't work is simple.
Let's pretend (ignoring for a moment that scalping is a terrible method):
Trade #1 - Enter long @ 9am, exit for loss @ 9:30am
Trade #2 - Enter short @ 9:35am, exit for loss @ 9:40am
Trade #3 - Enter short @ 9:50am, exit for profit @ 9:58am
If you swap the EnterLong and EnterShort's it may look something like this:
Trade #1 - Enter short @ 9am, exit for loss @ 9:39am
Trade #2 - Enter long @ 9:48am, exit for loss @ 9:56am
Trade #3 - Enter short @ 10:04am, exit for loss @ 10:10am
See, everything changes because you flipped the signal. It's not a 1:1 relationship. This will be proven to you if someone makes the changes to your code.
There is already a reverse option in the strategy
Problem is that the entry prices are different and trying to enter manually against the strategy sometimes doesn't work
I took a quick'ish look at your code just to get a feel for what you have going on.
I then ran a couple of quick tests on some historical data. I was not able to get your start time code to work properly, so my test runs include some pre-market trades.
I selected a random day in the middle of august and downloaded the TF replay data for that day. I have no idea what the chart looks like, just to keep my simple test unbiased.
I started with a 1 minute chart and set a few parameters, which generated a profit for the day. (See attached snapshot's for details). I set the profit target to 100 ticks, otherwise used your 10 tick stop loss. At first look the auto trail 1 and 2 didn't make any sense to me, I was not able to understand the intent of how it is supposed to work ?
I then set the reverse flag to True , and the result was a small loss for the day.
I then changed the time frame to 15 minutes and ran the reverse test again which produced a profit for the day.
I will go back and look at the code in relation to the reverse logic in specific for any idea to answer your actual question.
I would only take signals where the candle was at least 80% or more body, not so much wick. Also, did the candle close near the highs or lows of the bar? Think about it: if you have a candle that makes a new high/low, but it is rejected with counter selling/buying, then that's a weak breakout candidate. If a buy signal's bar closes on or near the highs, then it's a good buy signal. If it's retraces to a doji-like formation, weak entry. Look for volume patterns too.
Also, I wouldn't use fixed-tick targets/stops, use a percentage of ATR, that way it adjusts to the current market volatility regime. A 10 tick move in August was a lot easier to achieve than a 10 tick move in June.
Check when it works best (hours of the day, days of the week, etc). Beware of data-mining here though.
This morning I modified the reverse code to look at only the Dochian channel in filtering the reversal signals. So, instead of looking at the current candle, the logic now compares the current channel level to the level for the previous bar.
The code and results are below, basically it had little effect on the strategy performance. I think this code/logic modification better maintains the original intent of the strategy author to have a pure (and simple) Dochian channel signal. Looking at or comparing candles drifts into interpreting price action and moves away from a pure Dochian channel signal.