/ES Futures, /GC, and even FX Trading strategy For ThinkOrSwim

AH! That is just the strategy "filling orders". It doesn't actually trade, but if you right click the purple triangle on the candle, then select "show report" it will show you backtesting results of the strategy based on the timeframe you're looking at. If you want to make this go away copy this code as an indicator
Code:
#New and Improved Impulse type study by TradeByDay

input paintBars = yes;

input longLength = 34;
input shortLength = 21;
input signalLength = 10;
input averageType = AverageType.EXPONENTIAL;

plot ErgodicOsc = TrueStrengthIndex(longLength, shortLength, signalLength, averageType).TSI - TrueStrengthIndex(longLength, shortLength, signalLength, averageType).Signal;

plot ZeroLine = 0;

ErgodicOsc.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
ErgodicOsc.SetLineWeight(3);
ErgodicOsc.DefineColor("Positive", Color.UPTICK);
ErgodicOsc.DefineColor("Negative", Color.DOWNTICK);
ErgodicOsc.AssignValueColor(if ErgodicOsc >= 0 then ErgodicOsc.Color("Positive") else ErgodicOsc.Color("Negative"));
ZeroLine.SetDefaultColor(GetColor(7));

input Channel_Length = 10; #10
input Average_Length = 21; #10
input over_bought_1 = 60;
input over_bought_2 = 53;
input over_sold_1 = -60;
input over_sold_2 = -53;
input show_bubbles = yes;
input show_sec_bbls = no;
input show_alerts = yes;
def ap = hlc3;
def esa = ExpAverage(ap, Channel_Length);
def d = ExpAverage(AbsValue(ap - esa), Channel_Length);
def ci = (ap - esa) / (0.015 * d);
def tci = ExpAverage(ci, Average_Length);
def wt1 = tci;
def wt2 = SimpleMovingAvg(wt1, 4);
#def zero = 0;
plot zero = 0;
zero.SetDefaultColor( Color.GRAY );

plot wt1_1 = wt1;
wt1_1.SetDefaultColor(Color.GREEN);
plot wt2_1 = wt2;
wt2_1.SetDefaultColor(Color.RED);
wt2_1.SetStyle(Curve.POINTS);
plot wt3 = (wt1 - wt2);
wt3.SetDefaultColor(Color.BLUE);
wt3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
def signal1 = wt1 crosses above wt2 and wt1 < over_sold_2;
plot Signal = if signal1  then (signal1 * over_sold_2) else Double.NaN;
Signal.SetDefaultColor(Color.GREEN);
Signal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
Signal.SetLineWeight(3);
Signal.HideTitle();
def signal2 = wt1 crosses below wt2 and wt1 > over_bought_2;
plot Signal2_ = if signal2  then (signal2 * over_bought_2) else Double.NaN;
Signal2_.SetDefaultColor(Color.RED);
Signal2_.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
Signal2_.SetLineWeight(3);
Signal2_.HideTitle();

def GreenPrice = wt3 > 0 and ErgodicOsc > 0;
def RedPrice = wt3 < 0 and ErgodicOsc < 0;

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then GlobalColor("Bullish") else if RedPrice then GlobalColor("Bearish") else GlobalColor("Neutral"));
 
AH! That is just the strategy "filling orders". It doesn't actually trade, but if you right click the purple triangle on the candle, then select "show report" it will show you backtesting results of the strategy based on the timeframe you're looking at. If you want to make this go away copy this code as an indicator
Code:
#New and Improved Impulse type study by TradeByDay

input paintBars = yes;

input longLength = 34;
input shortLength = 21;
input signalLength = 10;
input averageType = AverageType.EXPONENTIAL;

plot ErgodicOsc = TrueStrengthIndex(longLength, shortLength, signalLength, averageType).TSI - TrueStrengthIndex(longLength, shortLength, signalLength, averageType).Signal;

plot ZeroLine = 0;

ErgodicOsc.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
ErgodicOsc.SetLineWeight(3);
ErgodicOsc.DefineColor("Positive", Color.UPTICK);
ErgodicOsc.DefineColor("Negative", Color.DOWNTICK);
ErgodicOsc.AssignValueColor(if ErgodicOsc >= 0 then ErgodicOsc.Color("Positive") else ErgodicOsc.Color("Negative"));
ZeroLine.SetDefaultColor(GetColor(7));

input Channel_Length = 10; #10
input Average_Length = 21; #10
input over_bought_1 = 60;
input over_bought_2 = 53;
input over_sold_1 = -60;
input over_sold_2 = -53;
input show_bubbles = yes;
input show_sec_bbls = no;
input show_alerts = yes;
def ap = hlc3;
def esa = ExpAverage(ap, Channel_Length);
def d = ExpAverage(AbsValue(ap - esa), Channel_Length);
def ci = (ap - esa) / (0.015 * d);
def tci = ExpAverage(ci, Average_Length);
def wt1 = tci;
def wt2 = SimpleMovingAvg(wt1, 4);
#def zero = 0;
plot zero = 0;
zero.SetDefaultColor( Color.GRAY );

plot wt1_1 = wt1;
wt1_1.SetDefaultColor(Color.GREEN);
plot wt2_1 = wt2;
wt2_1.SetDefaultColor(Color.RED);
wt2_1.SetStyle(Curve.POINTS);
plot wt3 = (wt1 - wt2);
wt3.SetDefaultColor(Color.BLUE);
wt3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
def signal1 = wt1 crosses above wt2 and wt1 < over_sold_2;
plot Signal = if signal1  then (signal1 * over_sold_2) else Double.NaN;
Signal.SetDefaultColor(Color.GREEN);
Signal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
Signal.SetLineWeight(3);
Signal.HideTitle();
def signal2 = wt1 crosses below wt2 and wt1 > over_bought_2;
plot Signal2_ = if signal2  then (signal2 * over_bought_2) else Double.NaN;
Signal2_.SetDefaultColor(Color.RED);
Signal2_.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
Signal2_.SetLineWeight(3);
Signal2_.HideTitle();

def GreenPrice = wt3 > 0 and ErgodicOsc > 0;
def RedPrice = wt3 < 0 and ErgodicOsc < 0;

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then GlobalColor("Bullish") else if RedPrice then GlobalColor("Bearish") else GlobalColor("Neutral"));
Ok great thanks Ill keep it in there to test thank you for this
 
I think with ehler's arrows giving so many signals, I will be leaving it alone for awhile. When the markets settle down I will re-introduce it into the plan. Added HACOLT to the system as a way to filter out some chop. Simplified 3 indicators into 1 candle painting system (Oscillator, Ergodic, and HACOLT). Just uncheck all plots for chart visual purposes. Add whatever you want to the system itself (similar to the CSA trading system) or have the preferred indicators separate. This works well with ES 10,000tick chart and NQ 4,000tick chart (also for NQ change channel length to 10 and average length to 21 in the settings). For GC or RTY you will want to delete HACOLT from the system and can run on either 5min or 1,000tick chart. Please share any feedback, changes that show progress, or additions that made it better!

https://tos.mx/qRJ7nGp
 
Made a change to the third piece of the pie from HACOLT to the WilliamsAD instead. It has proven to be a better trend indicator so it has eliminated a lot of poor reversals. Last 5 days would net about $6,000 trading /ES (10,000 tick chart) and /RTY (1,000) tick chart) together for a total of 54 trades between the hours of 6:05am-12:50pm, avoiding the ON session and chopping off a bit of the start and end of the day to avoid regular chop due to an increase in volume (and volatility) at those blocks of time. The backtest shows the strategy's validity, but by no means would I trade every signal, nor hold through all the candles until trend bias changes, I don't have those kinds of nerves. But this gleams great trend bias during specific times of the day allowing for easy scalps. Happy hunting! https://tos.mx/lGWApIC
 
/CL when i put it to lower charts 5m

25eyCXm.png
 
@tradebyday I only see colorpaintbars, the arrows don't appear though.
this meant to be used on lower charts?
The arrows are for the standalone indicator. I eliminated them as they were: 1)not an accurate depiction of trend reversal... 2) were not needed for my style of trading. The color paints are to give you trend bias to trade within based on factors like volume and PA as well. If you wish to keep using that oscillator (which I do like a lot) eliminate all the lines and arrows and just keep the histogram (labeled wt3) as it is the best visually and requires less chart space (y)
 
I will also say that the settings in my system would need to be changed greatly for /CL as oil is ever oscillating, where as my system is more trend based while at the current settings and configuration. Maybe a change to the indicators themselves would yield better results in /CL too
 
I tried this way, extremely well to prevent bad entries and signals an exit. Will be looking to trade live on this today.
Trying to keep osci and histogram on, hide the others.

The arrows are for the standalone indicator. I eliminated them as they were: 1)not an accurate depiction of trend reversal... 2) were not needed for my style of trading. The color paints are to give you trend bias to trade within based on factors like volume and PA as well. If you wish to keep using that oscillator (which I do like a lot) eliminate all the lines and arrows and just keep the histogram (labeled wt3) as it is the best visually and requires less chart space (y)
 
excellent indications signals.. the win:loss ratio is decent too, as long as not trade in consolidation the signals are 80% accurate
anyone how how to add in an alarm " ring" when the signal appear? thank you

Code:
#  
# TD Ameritrade IP Company, Inc. (c) 2012-2020
#

input length = 21;
input paintBars = yes;

def EMA = ExpAverage(close, length);
def MACD = ExpAverage(close, 12) - ExpAverage(close, 26);
def MACDHist = MACD - ExpAverage(MACD, 9);
def GreenPrice = EMA > EMA[1] and MACDHist > MACDHist[1];
def RedPrice = EMA < EMA[1] and MACDHist < MACDHist[1];

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then GlobalColor("Bullish") else if RedPrice then GlobalColor("Bearish") else GlobalColor("Neutral"));

AddOrder(OrderType.BUY_AUTO, Bullish);
AddOrder(OrderType.SELL_TO_CLOSE, Neutral);
AddOrder(OrderType.SELL_AUTO, Bearish);
AddOrder(OrderType.BUY_TO_CLOSE, Neutral);
 
i added this to bottom
Code:
input AudibleAlerts = yes;
Alert(AudibleAlerts and OrderType.BUY_AUTO, GetSymbol() + "buy", Alert.BAR, Sound.Ring);
Alert(AudibleAlerts and OrderType.SELL_TO_CLOSE, GetSymbol() + "buy", Alert.BAR, Sound.Ring);
Alert(AudibleAlerts and OrderType.SELL_AUTO, GetSymbol() + "sell", Alert.BAR, Sound.Ring);
Alert(AudibleAlerts and OrderType.BUY_TO_CLOSE, GetSymbol() + "buy", Alert.BAR, Sound.Ring);
 
I will also say that the settings in my system would need to be changed greatly for /CL as oil is ever oscillating, where as my system is more trend based while at the current settings and configuration. Maybe a change to the indicators themselves would yield better results in /CL too
Are you still using this system currently? and have you made any changes?
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
413 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top