I'm working on a strategy which works best when the market is not trending.
Here's what keeps happening... the market starts to trend... and of course... there are peaks and valleys in a trend as well as in a sideways market.. so... the strategy sees the highs in an uptrend... and shorts pretty much all of them!
Then... turns around and goes long in a downtrend on every new low... ouch! Talk about a smackdown!
It wouldn't be so bad if it only bought the lows in an uptrend or the highs in a downtrend... but when the market is running fairly smoothly downward, the peaks and valleys are tiny in the instrument I trade... so basically I'm getting trending whipsaw.
Has anyone else pondered ways to keep this from happening using NinjaScript to tell the strategy to only take trades in the direction of the trend once it starts?
I figured I'd ask the experts and more experienced coders so I can learn as I go. Plus... If I don't figure this out soon... I won't have a head left to scratch.
-V
Comment