Combined Indicators with detrendedPriceOscilator

lovetoloughlouder

New member
VIP
Hi can any one help me writing a script with the below conditions
Arrow Up when
close > 200 EMA
low is <= HLC3 AdaptiveEMA && Close > HLC3 AdaptiveEMA(with input length 34,34) and DPO DetrendedPriceOscilator(34,34,HLC3) >= ZeroLine

Arrow DOWN when the Opposite of the above

I have other conditions like
RSI_AVG RSI_A > 50(mid) or RSI_A > rsiavg with arrow up and the opposite for arrow down
And RecurssiveMA as well if possible

I can explain more if needed


Plot arrowUP = close is greater than or equal to MovAvgExponential("length" = 200)."AvgExp" and low is less than or equal to AdaptiveEMA("price" = hlc3, "length" = 34, "high low length" = 34) and close is greater than or equal to AdaptiveEMA("price" = hlc3, "length" = 34, "high low length" = 34) and RSI_AVG()."RSI_A" is greater than or equal to RSI_AVG()."rsiavg" and DetrendedPriceOsc("color norm length" = 34, "length" = 34)."DPO" is greater than DetrendedPriceOsc("color norm length" = 34, "length" = 34)."ZeroLine"

and opposit for arrowdown
@samer800 or @chewie76 can you help on this please

I have tried to call those other indicators on my current script with their parameters, but for some reason they gave me error as not recognized, . if any could help on the initial I might be able to figure out to modify more, I really would appreciate any ones initial code setup.


Thank you for your time
Appreciate your help
 

Attachments

  • Screenshot 2023-11-19 at 8.16.29 PM.png
    Screenshot 2023-11-19 at 8.16.29 PM.png
    270.2 KB · Views: 156
Last edited:
something like this:
Code:
declare upper;

# Arrow Up when
# close > 200 EMA
# low is <= HLC3 AdaptiveEMA && Close > HLC3 AdaptiveEMA(with input length 34,34) and DPO DetrendedPriceOscilator(34,34,HLC3) >= ZeroLine

def condition_1 = if close > MovAvgExponential(length = 200) then 1 else 0;
def condition_2 = if low <= AdaptiveEMA(price = HLC3, length = 34, "high low length" = 34) then 1 else 0;
def condition_3 = if close > AdaptiveEMA(price = HLC3, length = 34, "high low length" = 34) then 1 else 0;
def condition_4 = if DetrendedPriceOsc("color norm length" = 34, length = 34, price = HLC3) >= DetrendedPriceOsc("color norm length" = 34, length = 34, price = HLC3).zeroLine then 1 else 0;

def buy = if sum(condition_1 + condition_2 + condition_3 + condition_4, length = 1) == 4 then 1 else 0;

def sell = if sum(condition_1 + condition_2 + condition_3 + condition_4, length = 1) == 1 then 1 else 0;

addOrder(OrderType.BUY_AUTO, buy == 1, tradeSize = 1);

addOrder(OrderType.SELL_AUTO, sell == 1, tradeSize = 1);

but looking at it on a couple of timeframes and tickers, i wonder if I got it right as the performance is not so hot.

To get ANY sell signal to trigger, I had to set the sum to 1 as it never goes to zero... which means one of the conditions in the top part is ALWAYS true. Not sure which one though.

-mashume
 

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
576 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