A Project for TradeStation Day-Traders

Here is a neat little day trader system that takes advantage of what some technicians call a “CLEAR OUT” trade.  Basically traders push the market through yesterday’s high and then when everybody jumps on board they pull the rug out from beneath you. This strategy tries to take advantage of this. As if it's OK, but it could be made into a complete system with some filtering. It's a neat base to start your day-trading schemes from.

But first, have you ever encountered this one when you only want to go long once during the day?

I have logic that examines market Position, and if it changes from a non-1 value to 1 then I increment buys Today. Since there isn’t an intervening bar to establish a change in marketPosition, then buys Today does not get incremented and another buy order is issued. I don’t want this. Remember to plot on the @ES.D.

Here’s how I fixed it and also the source of the CLEAR-OUT day-trade in its entirety. I have a $500 stop and a $350 take profit, but it simply trades way too often. Have fun with this one – let me now if you come up with something.

inputs: clearOutAmtPer(0.1),prot$Stop(325),prof$Obj(500),lastTradeTime(1530);

vars: coBuy(false),coSell(false),buysToday(0),sellsToday(0),mp(0),totNumTrades(0);

If d <> d[1] then
Begin
coBuy = false;
coSell = false;
buysToday = 0;
sellsToday = 0;
totNumTrades = totalTrades;
end;

mp = marketPosition;
If mp[1] <> mp and mp = 1 then buysToday = buysToday + 1;
If mp[1] <> mp and mp = -1 then sellsToday = sellsToday + 1;

If h > highD(1) + clearOutAmtPer * (highD(1) - lowD(1)) then coSell = true;
If l < lowD(1) - clearOutAmtPer * (highD(1) - lowD(1)) then coBuy = true;

If totNumTrades <> totalTrades and mp = 0 and mp[1] = 0 and positionProfit(1) < 0 and entryPrice(1) > exitPrice(1) then buysToday = buysToday + 1;
If totNumTrades <> totalTrades and mp = 0 and mp[1] = 0 and positionProfit(1) < 0 and entryPrice(1) < exitPrice(1) then sellsToday =sellsToday + 1;

totNumTrades = totalTrades;

If buysToday = 0 and t < lastTradeTime and coBuy = true then buy ("COBuy") next bar at lowD(1) + minMove/priceScale stop;
If sellsToday = 0 and t < lastTradeTime and coSell = true then sellShort ("COSell") next bar at highD(1) - minMove/priceScale stop;

setStopLoss(prot$stop);
Setprofittarget(prof$Obj);
setExitOnClose;

About the Author George Pruitt

I graduated from UNC – Asheville with a B.S. degree in Computer Science many years ago. I joined Futures Truth as a senior in college in 1989 as a C programmer and incorporated a sophisticated and large programming project into my senior project [Excalibur]. I have been there for nearly 29 years and have authored many articles in magazines and trade journals. I have written and co-written three books that can be purchased at Amazon.com: The Ultimate Trading Guide, Building Winning Trading Systems with TradeStation – (first and second editions), The Ultimate Algorithmic Trading System Toolbox.

  • Giuseppe says:

    Nice!

  • Red says:

    I thought mp is a TradeStation reserved word? Hence, you may want to change mp to say mp1?

  • Awesome post! Keep up the great work! 🙂

  • Steve says:

    Just to be clear, these strategy results are without slippage and commission, correct? So, best case, with costs included this is just a breakeven strategy at best (and probably worse) – amiright?

  • >