Need Help: Hull Di+ Di- Strategy

rihboi3087

New member
Hello there, I was watching this video on backtesting a strategy and the results look promising. So I was wondering if someone can help writing the strategy on TOS.
See Video here for context.

A simplified version would work perfectly too
TF 1MN
Long: price closes above HULL 88 and Di+ crosses above Di-
R/R 1:1.5
Short: price closes below hull 88 and Di- crosses above Di+

Thank you in advance
 
Solution
Hello there, I was watching this video on backtesting a strategy and the results look promising. So I was wondering if someone can help writing the strategy on TOS.
See Video here for context.

A simplified version would work perfectly too
TF 1MN
Long: price closes above HULL 88 and Di+ crosses above Di-
R/R 1:1.5
Short: price closes below hull 88 and Di- crosses above Di+

Thank you in advance

See if this helps you get started. Put the script in create Strategy rather than Study

Capture.jpg

Ruby:
#A simplified version would work perfectly too
#TF 1MN
#Long: price closes above HULL 88 and Di+ crosses above Di-
#R/R 1:1.5
#Short: price closes below hull 88 and Di- crosses above Di+

input length  = 88;
input avgtype =...
Hello there, I was watching this video on backtesting a strategy and the results look promising. So I was wondering if someone can help writing the strategy on TOS.
See Video here for context.

A simplified version would work perfectly too
TF 1MN
Long: price closes above HULL 88 and Di+ crosses above Di-
R/R 1:1.5
Short: price closes below hull 88 and Di- crosses above Di+

Thank you in advance

See if this helps you get started. Put the script in create Strategy rather than Study

Capture.jpg

Ruby:
#A simplified version would work perfectly too
#TF 1MN
#Long: price closes above HULL 88 and Di+ crosses above Di-
#R/R 1:1.5
#Short: price closes below hull 88 and Di- crosses above Di+

input length  = 88;
input avgtype = AverageType.HULL;

def ATR_      = reference ATR();
def "DI+"     = reference DIPlus();
def "DI-"     = reference DIMinus();

plot ma       = MovingAverage(avgtype, close, length);
ma.AssignValueColor(if ma >= ma[1] then Color.GREEN else Color.RED);

#Conditions
plot Long       = if close > ma and "DI+" crosses above "DI-" then close else Double.NaN;
Long.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
def Longtarget = Long + ATR_ * 1.5;
def LongStop   = Long - ATR_;

plot Short       = close < ma and "DI-" crosses above "DI+";
Short.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
def Shorttarget = Short - ATR_ * 1.5;
def ShortStop   = Short + ATR_;

#Orders
AddOrder(type = OrderType.BUY_TO_OPEN, condition = Long, tickColor = Color.GREEN, arrowColor = Color.GREEN);
AddOrder(type = OrderType.SELL_TO_CLOSE, condition = Longtarget or LongStop or Short, tickColor = Color.WHITE, arrowColor = Color.WHITE);

AddOrder(type = OrderType.SELL_TO_OPEN, condition = Short, tickColor = Color.RED, arrowColor = Color.RED);
AddOrder(type = OrderType.BUY_TO_CLOSE, condition = Shorttarget or ShortStop or Long, tickColor = Color.YELLOW, arrowColor = Color.YELLOW);


#Test
input test = no;
AddChartBubble(test and Long, low, "T " + Longtarget + "\nE " + Long + "\nS " + LongStop, Color.GREEN, no);
AddChartBubble(test and Short, high, "S " + ShortStop + "\nE  " + Short + "\nT " + Shorttarget, Color.RED, yes);
;
 
Solution

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
518 Online
Create Post

Similar threads

Similar threads

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