Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Need assistance getting a posted script to compile
I'm a new member here and would like to thank everyone in advance for any assistance they can provide.
I've been using a MultiCharts trial for awhile now but I have ZERO programming experience and trying to write, what I assume, is a basic script has been a nightmare for me. The primary draw of MC was the ability to backtest and confirm what I believe is a profitable day trade strategy.
In searching online for example codes and videos I stumbled across Big Mike's video tutorial which was great, but I'm still not there yet. I have found what appears to be the basis of the code I need, but when I enter it into MC I cannot get it to compile.
Apparently I cannot post the link for the code I was going to adjust to my settings, so I will post it here.
Again, I have about 3 days worth of coding experience, so I'm sure it's something simple I'm missing, but any help would be appreciated. I do not need all of the coloring to work, but it would be a great visual I bet.
// ChartArt's RSI + Bollinger Bands, Double Strategy
//
// Version 1.0
// Idea by ChartArt on January 14, 2015.
//
// This strategy uses a modfied RSI to sell
// when the RSI increases over the value of 55
// (or to buy when the value falls below 45),
// with the classic Bollinger Bands strategy
// to sell when the price is above the
// upper Bollinger Band (and to buy when
// this value is below the lower band).
//
// This simple strategy only triggers when
// both the RSI and the Bollinger Bands
// indicators are at the same time in
// a overbought or oversold condition.
//
// List of my work:
// __ __ ___ __ ___
// / ` |__| /\ |__) | /\ |__) |
// \__, | | /~~\ | \ | /~~\ | \ |
//
//
///////////// Colors
switch1=input(true, title="Enable Bar Color?")
switch2=input(true, title="Enable Background Color?")
TrendColor = RSIoverBought and (price[1] > BBupper and price < BBupper) ? red : RSIoverSold and (price[1] < BBlower and price > BBlower) ? green : na
barcolor(switch1?TrendColor:na)
bgcolor(switch2?TrendColor:na,transp=50)
///////////// RSI + Bollinger Bands Strategy
if (not na(vrsi))
if (crossover(vrsi, RSIoverSold) and crossover(source, BBlower))
strategy.entry("RSI_BB_L", strategy.long, stop=BBlower, oca_type=strategy.oca.cancel, comment="RSI_BB_L")
else
strategy.cancel(id="RSI_BB_L")
if (crossunder(vrsi, RSIoverBought) and crossunder(source, BBupper))
strategy.entry("RSI_BB_S", strategy.short, stop=BBupper, oca_type=strategy.oca.cancel, comment="RSI_BB_S")
else
strategy.cancel(id="RSI_BB_S")
It starts with {";" expected} at the end of the script, but then as I go through and try to complete the fixes including {")" expected} keep popping up. I add the close brackets and then it gets to the errors where all the inputs are unrecognized.
(and (price[1] < BBlower and price > BBlower) ? green : na
barcolor(switch1?TrendColor:na)
bgcolor(switch2?TrendColor:na,transp=50));
"wrong expression"
I have tried going through and re-labeling all of the inputs similar to how Big Mike laid them out in one of his videos. Errors about wrong expression or expected values continue to pop up everywhere.
It was posted under the EasyLanguage section, but looked different then many others I had seen. I guess I hoped there were multiple ways you could express the same functions.
Looks like I need to take this to the Hire a Programmer forum for now.
The code you posted is unfortunately for TradingView, and so won't work with MultiCharts or any other EasyLangauge-compatible platform. That means each TradingView line needs to be rewritten to the MultiCharts equivalent.
The good news is that the TradingView code will work on MultiCharts (in terms of behaviour). Some of the graphical features won't work on MultiCharts as they do on TradingView, though. Those include colouring the chart's background (which the `bgcolor()` function in your posted code does) and the `fill()` function to colour the background between two plots.
Oops, didn't notice that Trading View was an API of it's own. I've been an options trader for years so I've always used my brokerage's platform. This third party platform stuff is new to me. Thanks for the clarification!
When I googled Easy Language and BB+RSI signals I received the hit for Trading View and assumed it was in Easy Language. We learn the hard way, right?