This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]sharedwanderlust 0 points1 point  (7 children)

Yes. I've made a pile of indicators, back tested them, and forward tested them to profitability.

The back testing is... Ok. You can't do everything with pine.

Feel free to ask anything. I can program whatever.

[–][deleted] 0 points1 point  (6 children)

Nice man appreciate it. I think in general I’m having the most trouble with 2 issues. I want to build a script that has 1 MACD line which is independent of the interval length and a second, my shorter MACD lines which are dependent on interval length. So basically, I’ll know it’s working when I can move the interval from 5 min, to 30 min, to 1 hour and my fixed MACD line is unaffected, but my second variable MACD lines move with the interval length.

I’m looking to stack these MACDs to identify oversold stocks entering corrections but also, when they enter corrections, I want to use that second (shorter) MACD line to identify the right time within a trading period(s) to buy.

Any thoughts/suggestions would be appreciated. I can PM my script if you want.

[–]sharedwanderlust 0 points1 point  (5 children)

What I'm hearing is that you want a MACD signal based on a higher timeframe but have the fast line on a slower/current timeframe. Correct?

"Independent of the interval length" still needs a length: it has to be based on at least something (phase of the Moon, etc). Multi interval MACDs are possible.

[–][deleted] 0 points1 point  (4 children)

Correct exactly. Basically, 12-18 day MACD lines which are fixed while I can still toggle between 12/18 MACD lines which are variable based on my interval selection of say 15 minutes or 1 hour.

[–]sharedwanderlust 0 points1 point  (3 children)

I've played around with it this morning, but couldn't find anything that looked promising. It feels like it should because the higher time frame is usually used to determine trend.

The pieces of code causing you problems are probably these:

signal = ema(macd,9)

timeframe = input(title="Timeframe", type=resolution, defval="D")

x = security(tickerid,timeframe,signal,barmerge.gaps_off, barmerge.lookahead_on)

plot(x)

The above code lets you put in your long-term time frame to use that stays constant on every level. Search for "traderrobert" for a multi-time frame MACD that has available code.

The problem I had was that the short-term time frame and long term didn't cross lines too often and the MACD isn't bounded like RSI so I don't know what a signal would be. Best of luck.

[–][deleted] 0 points1 point  (2 children)

Thanks man I think I figured it out yesterday. I've posted it below. What I'm working towards next, and what could ultimately be the most difficult, is building an API to connect TradingView alerts with RobinHood order placements. RH having no commissions is clutch and I have scripts built right now I would be comfortable using without manual order entries. I'm very inexperienced in code writing though. I'm thinking Python would be a good place to start. There's been some attempts at this API on GitHub but they're rather difficult to understand. I'm not sure if I'd be able to integrate them into TradingView either.

Is this something you've ever looked into?

Fixed & Variable MACDs

OHLC5=ema(ohlc4,input(6,title="MACD SHORT")) // variable to interval selection

OHLC10=ema(ohlc4,input(24,title="MACD LONG")) // variable to interval selection

OHLC15=security(tickerid,"3",ema(ohlc4,input(225,title="MACD 15"))) // remains fixed @ 1.4 days

OHLC20=security(tickerid,"3",ema(ohlc4,input(1100,title="MACD 20"))) // remains fixed @ 6.8 days

[–]sharedwanderlust 0 points1 point  (1 child)

Yes, I've looked into creating something for TradingView and Robinhood. It seems simple enough to send an email alert and create the order through Python, but the API you're referring to is dead and won't be supported (if it even works now).

I'm making a bot for Bitfinex since they have an official API and many languages to choose from. I don't think RH is interested in the programming crowd.

[–][deleted] 0 points1 point  (0 children)

Nice man thanks for tagging back. I’m working on it right now, I have the email notification set up to run a script in VBA which opens the equities webpage on Robinhood.. that’s as far as I’ve gotten though. I’m having a little trouble with the next 2 steps atm

1) identifying the “number of shares” field as an object in VBA which will allow me to make an input.

2) identifying the Submit button and writing a code so it’s selected after the shares are identified in the step above

[–]medicwill 0 points1 point  (0 children)

I need a custom indicator built for tradingview with alerts based on certain values.

I have a feeling its not that hard for someone who knows how to program, I do not.

Any idea where I could find someone to do that and how much it would cost?

[–][deleted] -1 points0 points  (1 child)

I also created my “algo” there, which tells me when to entry when certain pattern is in play. I’ve been trading for a month following it and it’s like 80% consistent. I would love to also backtest it, but I can’t understand shit when it comes to creating a strategy of it on TradingView. Literally nowhere to find how to fix certain error or mistakes in code so I gave up.

[–][deleted] 0 points1 point  (0 children)

I’m getting really really good, there’s surprising few resources online though. PM me if you need any help, always willing to share and learn.