Avoid Same Bar Whipsaws V1.1

v 1.1 - modified December 15, 2009

Summary of changes

Changed defaults for targets and stops, after queries indicated that most users were using the default 1 tick while evaluating v1.0, which naturally resulted in 1 bar whipsaws.
Added remarks to better explain the code.
Added notes to initial description, to explain what the strategy does.

################################

Released with no copyright.

It is free to use for any purpose.

This is demonstration of how to set up a strategy that will not whipsaw trades on the same bar as entry. I seemed to have that problem with a lot of the strategies that I wrote that were designed to reverse in the market if conditions reversed, which is why I wrote this, as an example template.

The strategy keeps you always in the market until either:

The profit target is hit; or
The stop loss is hit; or
Market conditions reverse.

Either of the first 2 exit conditions takes you flat; the 3rd condition causes an immediate reversal from long to short, or short to long, as the case may be.

To stay always in regardless, use excessively large stops and targets.

By using this code, you accept all responsibility for any results that may occur. This is not a recommendation to use the code to trade any equity in a live market.

Any investments, trades and/or speculations using this code are made solely at your own risk, financial or otherwise. Results will be dependent on market conditions, timing and your trading style.

If you disagree with these conditions, please do NOT use the code.

########################################################################
!!!!! Translation: You are responsible for your own investment decisions. Not anyone else. YOU !!!!!
########################################################################

Created By koganam
NinjaTrader Version 7
File Size 4.3 KB
Create Date(s) 07/14/2010
# of Downloads 5052

Importing to NinjaTrader 7 is Easy!

To import your 3rd party app or add-on to NinjaTrader, simply follow these 3 steps:

  1. Download the app or add-on file to your desktop
  2. From the NinjaTrader Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file from your desktop

Questions?

Visit the NinjaScript File Sharing discussion in the NinjaTrader user forum to interact with fellow traders and the NinjaTrader support team.