dap711
Active member
Stats for the entire day today. I did NOT take any of these trades as I'm new to this and watching for now. Pretty (REALLY) good results.
/MES chart at 1D - 1M
Backtest at 1, Length 7
SMI Lower, length 4
Floating P/L = $475
25 Trades
TD Amer Futures Commissions @$5.75
Net Profit: $331.25
0930 - 1600 EST
@Dap, did you figure out how to auto-trade this through TOS?
Hey @slowmohockey! Yes, I'm auto trading thru ToS .. see here: Video about using Marco Recorder to auto trade. https://drive.google.com/file/d/1uq1IMBaUw96mFSAgL02d1LQcJT_3V8W_/view?usp=sharing
I have also modified the code some. I've combined Moving Average Master w/ ASAP and came up with the following. I optimized it to trade Gold Futures and have been making a killing with it. (Today was $4,640.00 trading one option)
Ruby:
# CHART TIMEFRAME MUST BE SET TO 1 MINUTE
input ShowStategyPositions = yes;
input tradesize = 1;
input SMI_FastLength = 2;
input SMI_Displace = 1;
input SMI_SlowLength = 83;
input TrendPrice = CLOSE;
input TrendLength = 181;
# Fast Stochastic Momentum Index (SMI)
def min_low = Lowest(low, SMI_FastLength+1);
def max_high = Highest(high, SMI_FastLength+1);
def rel_diff = close - (max_high + min_low) / 2;
def diff = max_high - min_low;
def avgrel = ExpAverage(ExpAverage(rel_diff, SMI_FastLength), SMI_FastLength);
def avgdiff = ExpAverage(ExpAverage(diff, SMI_FastLength), SMI_FastLength);
def SMI = if avgdiff != 0 then avgrel / (avgdiff / 2) * 100 else 0;
# Slow Stochastic Momentum Index (SMI)
def min_lows= Lowest(low, SMI_SlowLength+1);
def max_highs= Highest(high, SMI_SlowLength+1);
def rel_diffs= close - (max_highs + min_lows) / 2;
def diffs= max_highs - min_lows;
def avgrels= ExpAverage(ExpAverage(rel_diffs, SMI_SlowLength), SMI_SlowLength);
def avgdiffs = ExpAverage(ExpAverage(diffs, SMI_SlowLength), SMI_SlowLength);
def SMIS = if avgdiffs != 0 then avgrels / (avgdiffs / 2) * 100 else 0;
# Hull Moving Average
plot MA = MovingAverage(AverageType.HULL, TrendPrice, TrendLength);
MA.DefineColor("Up", GetColor(1));
MA.DefineColor("Down", GetColor(0));
MA.AssignValueColor(if MA > MA[1] then MA.color("Up") else MA.color("Down"));
def BuyToOpenSignal= SMI>SMI[SMI_Displace] and close > MA[1] and MA>MA[1] and SMIS>SMIS[1];
def SellToCloseSignal= close < MA[1] or SMIS<SMIS[1];
def SellToOpenSignal= SMI<SMI[SMI_Displace] and close < MA[1] and MA<MA[1] and SMIS<SMIS[1];
def BuyToCloseSignal= close > MA[1] or SMIS>SMIS[1];
AddOrder(OrderType.BUY_TO_OPEN, BuyToOpenSignal and ShowStategyPositions, open[-1], tradesize, Color.CYAN, Color.CYAN, "");
AddOrder(OrderType.SELL_TO_CLOSE, SellToCloseSignal and ShowStategyPositions, open[-1], tradesize, Color.CYAN, Color.CYAN, "");
AddOrder(OrderType.SELL_TO_OPEN, SellToOpenSignal and ShowStategyPositions, open[-1], tradesize, Color.RED, Color.RED,"");
AddOrder(OrderType.BUY_TO_CLOSE, BuyToCloseSignal and ShowStategyPositions, open[-1], tradesize, Color.RED, Color.RED,"");
def OpenOrders = GetQuantity();
AddLabel(yes, " BUY ", if BuyToOpenSignal[1] and OpenOrders < 1 then CreateColor(153, 255, 153) else Color.White);
AddLabel(yes, " SELL ", if SellToOpenSignal[1] and OpenOrders > -1 then CreateColor(255, 102, 102) else Color.White);
AddLabel(yes, " CLOSE ", if (SellToCloseSignal[1] and OpenOrders > 0) or (BuyToCloseSignal[1] and OpenOrders < 0) then Color.Yellow else Color.White);