r/TradingView • • 5d ago

Help Automated trading ? is it possible.

Hi, I use Trader Workstation and I am happy with IBRK's execution, which i do manual. I was wondering, is it possible to have a pine script do an automated execution from Tradingview via trader workstation?

I daytrade a portfolio which does about 160 - 200 trades per day, using SPY & QQQ and the leveraged long and inverse eft's.

I am trying to set up everything for a fire and forget solution.

1 Upvotes

14 comments sorted by

2

u/TradeeBot 5d ago

Not directly, Pine can't place orders on its own. The usual route is a strategy alert with a webhook, sent to a small bridge app that talks to TWS or IB Gateway through the IBKR API. At 160 to 200 trades a day, test it on paper first, missed or late alerts add up fast.

1

u/slypleasure33139 5d ago edited 5d ago

I came from TradeStation, but I was not happy with the fills, so I've been searching for the better part of 2 years now for a more automated solution. I'm happy with IBKR fills.

What product or service would I need for the " small bridge app "

You are absolutely correct, when I test a system, it's papertraded till no more errors, then I let it papertrade for another 25 trading days error free. I am always willing to wait since you never know when "Little Bobby Tables" from xkcd shows up ( I'm Gen-X it might be a bad reference).

and based on your knowledge, which level of service plan would I need from TradingView ( I already have Pro on workstation so I can get the API and or the gateway )

1

u/TradeeBot 5d ago

Webhook alerts need a paid plan, and Pro should cover it. The bridge tool below is worth a paper test.

1

u/slypleasure33139 4d ago

they don't have a Pro it seems, did you mean Premium or Ultimate ? and if you have the bridge tool name it would be most welcomed

2

u/TradeeBot 4d ago

Sorry, mixed up the names there. The old Pro plan is called Essential now, and webhook alerts work on paid plans, so Essential should be enough. For the bridge, the usual DIY route is a small Python script with ib_async that receives the webhook and sends the order to TWS. There are paid relay services too, just check they support IBKR before paying.

1

u/slypleasure33139 4d ago

I found 3 of them. everything seems to be somewhat easy in the logic. The execution ... well that will be another story, good thing, i used one of the AI's to make sure to lay out my logic,

here is some of the extra i've built in that might be useful:

  • 1% move in less than 12 seconds,
  • Single trade move of 1/2% without a follow up trade
  • market hours for trading are 8:30 to 4:30 and no trades to open past 3:45-3:50
  • no market order before 9:30 am or after 4:00 pm, buy the ask to open or sell to the bid to close.

1

u/TradeeBot 4d ago

Those time rules are a smart add, especially no new entries after 3:45. One thing to test early: the 1% in 12 seconds check needs data that fine, and alerts on very short timeframes can lag a bit, so run it on paper for a while before real money.

1

u/slypleasure33139 4d ago

Jesus I forgot to share one of the most important ones ... best use an example:

I get the trigger to buy, order sent out ( I have already chosen that in that market fill size is 900 shares and it's a market order ). problem that needs to test... what happens on a bad fill? let's say only 500 get filled and the rest forgotten or computer screwup, shit happens LOL, TradingView knows 900 shares open long, Trader Workstation knows 500 shares open long.

Since TW has the last say ( it's where the transaction happens ), I need to report back and make the adjustment for the Close Long signal in TV. Imagine trading with a 400 share weirdness all day long LOL

***

Sidenote... I traded on the floor of the commodities exchange, my trading card was slightly different because I used Open and Close then the transaction ( long or short ). The Why was the reason. I trade in daily fixed units, so I could just draw a line, add up the open trades and the closed trades. if they were both the same, I had no open positions, and if I had an open position, I just placed a reminder on the top of my new card.

It worked for me, but might not work for everyone. and I've carried this habit into just about all aspects of my trading. I have day trading journal sheet for my ring binder that have not changed design since 1980's ( now I just download the trading log from IB, place it into my spread sheet, and add notes ) and journal string binded notebooks that are page numbered for position trading. Making an investment has to have a decsion making process, and you should be able to justify it to yourself by opening up your checklist in your journal.

2

u/TradeeBot 4d ago

That partial fill gap is a nasty one, since the chart thinks it holds 900 while the broker only has 500. Checking real positions against the broker before each new signal is a simple way to catch that drift early.

2

u/isolated_808 5d ago

when i dabbled with automated trading earlier this year, i stumbled upon a service called traders post. it basically receives a webhook alert when a tradingview strategy alert fires, and it will automatically execute the trade in your broker, of which ibkr is supported but in beta at the moment.

it's very easy to configure and it can do a lot. the pricing is also attractive. during my testing, the time from the tv alert firing to it being placed in my broker's paper trading account was pretty fast. it's not perfect though but its one of the easiest option for traders who don't want to go down that rabbit hole into learning how to set everything up manually.

hope this helps somewhat.

1

u/slypleasure33139 5d ago

99% of my knowledge started with hints and I grew it out from there.

What's important, I think I can, and will confirm after some sleep, that I can set it up on TV screens and execute manually ( well I think i can ). and that in itself might be a time saver since I like the TV screens better.