Matching MC bars to TradingView bars  [SOLVED]

Questions about MultiCharts and user contributed studies.
quod_erat
Posts: 33
Joined: 14 Mar 2020
Has thanked: 4 times
Been thanked: 1 time

Matching MC bars to TradingView bars

Postby quod_erat » 07 Oct 2020

I'm using MC for my automated trading, but with the data connection to Interactive Brokers being exceptionally slow, I've started using TradingView for my general charting, and increasingly backtesting as well (their data for backtesting loads in fractions of a second, compared to the sometimes hour-long wait in MC, and I've been porting a lot of my backtesting code from EasyLanguage to Pine).

I've run into some issues with how MC and TradingView draw charts differently. A regular trading hours hourly chart in MC starts with a bar that closes at 10:00, then a second bar closing at 11, etc. A chart with pre-market would draw bars closing at 7, 8, 9, and then (oddly) 9:30, 10, 11, etc.

TradingView, on the other hand, labels bars by their opening time, and you get a 9:30, 10:30, etc. (or with premarket, 8, 9, 10, 11, etc.) bars.

This discrepancy leads to some differences in using TV for backtesting but MC for executing trades. For example, a length 9 SMA would be quite sensitive to these differences, and send trade signals differently in the TV compared to the MC setup, all other things being equal.

Is there a way to tweak how MC draws charts to be more aligned with TradingView (or if anyone has experience with the latter product, to tweak tradingview to be more in line with MC)?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Matching MC bars to TradingView bars

Postby JoshM » 08 Oct 2020

I use TradingView a lot and matching bars to MultiCharts is incredibly difficult. Like you already mentioned, there is a difference in bar time stamps.

But there are also significant data feed differences, since data on TradingView is different from the data feeds that MultiCharts uses. (Even the data feeds between TradingView's own instruments are different.) So getting an indicator or strategy to behave the same on both platforms is very difficult.
Is there a way to tweak how MC draws charts to be more aligned with TradingView (or if anyone has experience with the latter product, to tweak tradingview to be more in line with MC)?
The only option I can think of, is to define your own price bars with the custom resolution feature in the QuoteManager. That would allow you to code your own chart resolution.

I don't know of a manual option that can make MultiCharts charts behave like TradingView charts.
I'm using MC for my automated trading, but with the data connection to Interactive Brokers being exceptionally slow, I've started using TradingView for my general charting, and increasingly backtesting as well (their data for backtesting loads in fractions of a second, compared to the sometimes hour-long wait in MC, and I've been porting a lot of my backtesting code from EasyLanguage to Pine).
MultiCharts 14 comes with a historical data downloader, which might help with this situation. In theory it should allow MultiCharts to download historical data in the background without having to wait on it.

quod_erat
Posts: 33
Joined: 14 Mar 2020
Has thanked: 4 times
Been thanked: 1 time

Re: Matching MC bars to TradingView bars

Postby quod_erat » 08 Oct 2020

Thanks JoshM. I'm not too worried about the different data feeds -- these are 1h resolution bars, and I'm swing-trading them over a few days or longer, so a few cents of difference are ok. The timestamp, on the other hand, can create some weird cumulative differences between the two strategies.

What I've found is that I can use TradingView for a quick up/down check (is this strat on that stock profitable or not), and then use MC to verify and finetune.

Looking forward to the historical data downloader. I'm still running 12.

quod_erat
Posts: 33
Joined: 14 Mar 2020
Has thanked: 4 times
Been thanked: 1 time

Re: Matching MC bars to TradingView bars

Postby quod_erat » 12 Oct 2020


The only option I can think of, is to define your own price bars with the custom resolution feature in the QuoteManager. That would allow you to code your own chart resolution.

I don't know of a manual option that can make MultiCharts charts behave like TradingView charts.
Yikes -- I took a look around the custom resolutions, and it's pretty impenetrable without some documentation. Even just a template for basic bar charts would be nice; then the only tweak that we'd need to draw MC bars like TradingView is for the time stamp to be at the open rather than the close of the bar, which I should be able to infer from seeing the code for their default bar chart. But at least in my version, there's no way to access any such templates.

quod_erat
Posts: 33
Joined: 14 Mar 2020
Has thanked: 4 times
Been thanked: 1 time

Re: Matching MC bars to TradingView bars  [SOLVED]

Postby quod_erat » 12 Oct 2020

Turns out, there's a fairly basic solution that works pretty well here, at least for my bar resolution (move from 1h to 60min): viewtopic.php?t=46357

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Matching MC bars to TradingView bars

Postby JoshM » 14 Oct 2020

Yikes -- I took a look around the custom resolutions, and it's pretty impenetrable without some documentation. Even just a template for basic bar charts would be nice; then the only tweak that we'd need to draw MC bars like TradingView is for the time stamp to be at the open rather than the close of the bar, which I should be able to infer from seeing the code for their default bar chart. But at least in my version, there's no way to access any such templates.
I also looked more closely at the Custom Resolution feature because of this thread.

The lack of documentation is indeed a disadvantage, but perhaps I can write some useful articles around it with a little help from MultiCharts Support (already contacted them). :)

Although you luckily already got the situation solved with a much easier tweak!

jjlas
Posts: 4
Joined: 06 Apr 2016

Re: Matching MC bars to TradingView bars

Postby jjlas » 20 Oct 2020

Yikes -- I took a look around the custom resolutions, and it's pretty impenetrable without some documentation. Even just a template for basic bar charts would be nice; then the only tweak that we'd need to draw MC bars like TradingView is for the time stamp to be at the open rather than the close of the bar, which I should be able to infer from seeing the code for their default bar chart. But at least in my version, there's no way to access any such templates.
I also looked more closely at the Custom Resolution feature because of this thread.

The lack of documentation is indeed a disadvantage, but perhaps I can write some useful articles around it with a little help from MultiCharts Support (already contacted them). :)

Although you luckily already got the situation solved with a much easier tweak!
It would be a great idea and very helpful.

rc76
Posts: 44
Joined: 14 Oct 2020
Has thanked: 11 times

Re: Matching MC bars to TradingView bars

Postby rc76 » 13 Feb 2022

Thank you JoshM, that will be really helpful if we can have some options/examples for addressing the "time stamp to be at the open rather than the close of the bar" issue using Custom Resolution feature, if it is possible at all.

Maybe MC support can give us a hand here too?


Return to “MultiCharts”