Help converting a Pine Editor indicator (BBW) - MultiCharts | futures.io
futures.io futures trading


Help converting a Pine Editor indicator (BBW)
Started: by alex20037 Views / Replies:38 / 0
Last Reply: Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Reply
 
Thread Tools Search this Thread
 

Help converting a Pine Editor indicator (BBW)

  #1 (permalink)
Elite Member
Miami Lakes
 
Futures Experience: Beginner
Platform: Multicharts
Broker/Data: Interactive Brokers
Favorite Futures: Emini ES
 
Posts: 19 since Oct 2016
Thanks: 2 given, 3 received

Help converting a Pine Editor indicator (BBW)

I see TradingView had this indicator I'd like to use in Multicharts, it is called BBW and this is the code:

length = input(20, minval=1)
src = input(close, title="Source")
mult = input(2.0, minval=0.001, maxval=50)

basis = sma(src, length) //This seems to be the line I am having problems with

dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev
bbw = (upper-lower)/basis
plot(bbw, color=blue)

This is what I am trying to build in Multicharts .NET:

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;

namespace PowerLanguage.Indicator{
public class BBW : IndicatorObject {
public BBW(object _ctx):base(_ctx){
std = 2;
length = 20;
}
private IPlotObject plot1;

[Input]
private int std { get;set; }

[Input]
private int length { get;set; }

protected override void Create() {
// create variable objects, function objects, plot objects etc.
plot1 = AddPlot(new PlotAttributes("", EPlotShapes.Line, Color.Red));
}

protected override void StartCalc() {
// assign inputs
}

protected override void CalcBar(){
// indicator logic
var basis = AverageFC(Bars.CloseValue,length);
var dev = std * Bars.Close.StandardDeviationCustom(length,1);

plot1.Set( ( (basis+dev) - (basis-dev) )/basis );
}
}
}

When compiling it returns this error:
'PowerLanguage.Function.AverageFC' is a 'type' but is used like a 'variable' "BBW" [Indicator] Ln 31.

which comes from the line:
var basis = AverageFC(Bars.CloseValue,length);

What would be the right way to assign this variable "basis" its value please? The value should be the simple moving average over the last "length" close values.


As always any help is really appreciated, thank you.

Reply With Quote

Reply



futures.io > > > > Help converting a Pine Editor indicator (BBW)

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

2016 True Edge Awards: Voting is open until Jan 21!

Now
 

An Afternoon with FIO member Massive l

Elite only
 

Anthony Drager: Pulling the trigger with confidence

Elite only
 

Leo Murphy: The Art and Science of Technical Analysis

Elite only
 

FuturesTrader71: Ask Me Anything

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seasonality Indicator Converting Harvard NinjaTrader Programming 6 June 16th, 2015 12:52 PM
Converting mt4 indicator ? tradingstarpro MetaQuotes MetaTrader MQL Programming 8 May 26th, 2015 02:14 PM
Converting Indicator to Strategy help! MXASJ NinjaTrader Programming 12 September 1st, 2014 02:42 PM
converting indicator ness1g NinjaTrader 1 October 14th, 2013 02:29 PM
Help converting an indicator to N7 tomonly23 NinjaTrader Programming 2 December 14th, 2010 02:02 PM


All times are GMT -4. The time now is 02:34 AM.

no new posts
Page generated 2017-01-19 in 0.08 seconds with 19 queries on phoenix via your IP 174.129.78.73