NexusFi: Find Your Edge


Home Menu

 





Need assistance getting a posted script to compile


Discussion in MultiCharts

Updated
    1. trending_up 1,607 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Need assistance getting a posted script to compile

  #1 (permalink)
 
lonestarAK's Avatar
 lonestarAK 
Anchorage Alaska
 
Experience: Intermediate
Platform: NT8
Broker: InteractiveBrokers/IQ Feed
Trading: CL, NQ, 6J
Posts: 15 since Jul 2017
Thanks Given: 168
Thanks Received: 17

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.

Thanks in advance!
Tim

//@version=2
strategy("Bollinger + RSI, Double Strategy (by ChartArt)", shorttitle="CA_-_RSI_Bol_Strat", overlay=true)

// 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:
// __ __ ___ __ ___
// / ` |__| /\ |__) | /\ |__) |
// \__, | | /~~\ | \ | /~~\ | \ |
//
//


///////////// RSI
RSIlength = input( 16 ,title="RSI Period Length")
RSIvalue = input( 45 ,title="RSI Value Range")
RSIoverSold = 0 + RSIvalue
RSIoverBought = 100 - RSIvalue
price = close
vrsi = rsi(price, RSIlength)


///////////// Bollinger Bands
BBlength = input(20, minval=1,title="Bollinger Bands SMA Period Length")
BBmult = input(2.0, minval=0.001, maxval=50,title="Bollinger Bands Standard Deviation")
BBbasis = sma(price, BBlength)
BBdev = BBmult * stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
source = close
buyEntry = crossover(source, BBlower)
sellEntry = crossunder(source, BBupper)
plot(BBbasis, color=aqua,title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=silver,title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=silver,title="Bollinger Bands Lower Line")
fill(p1, p2)


///////////// 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")

//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Increase in trading performance by 75%
The Elite Circle
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
28 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

Tim,

what are the error messages you get and what do you need help with exactly?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #3 (permalink)
 
lonestarAK's Avatar
 lonestarAK 
Anchorage Alaska
 
Experience: Intermediate
Platform: NT8
Broker: InteractiveBrokers/IQ Feed
Trading: CL, NQ, 6J
Posts: 15 since Jul 2017
Thanks Given: 168
Thanks Received: 17


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.

Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

Tim,

the code contains parts that are not EasyLanuage/PowerLanguage and looks like it was meant for a different platform than Multicharts or Tradestation.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
 
lonestarAK's Avatar
 lonestarAK 
Anchorage Alaska
 
Experience: Intermediate
Platform: NT8
Broker: InteractiveBrokers/IQ Feed
Trading: CL, NQ, 6J
Posts: 15 since Jul 2017
Thanks Given: 168
Thanks Received: 17

That's what I was afraid of.

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.

Started this thread Reply With Quote
  #6 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


lonestarAK View Post
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"

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.

Reply With Quote
  #7 (permalink)
 
lonestarAK's Avatar
 lonestarAK 
Anchorage Alaska
 
Experience: Intermediate
Platform: NT8
Broker: InteractiveBrokers/IQ Feed
Trading: CL, NQ, 6J
Posts: 15 since Jul 2017
Thanks Given: 168
Thanks Received: 17

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?

Started this thread Reply With Quote




Last Updated on July 21, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts