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:111 / 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)
 

Mastering Trading Pysychology w/Brett Steenbarger & Trading Technologies

Elite only

PTMC Protrader Platform First Look w/Sergey Sokolov

Elite only

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only

FIO Video Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

April

Process above all else w/Anthony Crudele @ Futures Radio Show

Elite only

Machine Learning - Quantitative Trading w/Martin Froehler @ Quantiacs

Elite only

Market Dynamics w/Peter Davies @ Jigsaw Trading

Elite only

Ask Me Anything w/Patrick Rooney @ Trading Technologies

Apr 18

Ask Me Anything w/FuturesTrader71

Apr 19

Machine Learning w/Kris Longmore

Elite only

Market Analysis w/Dave Forss

Apr 25

Introducing iSystems with Stage 5 Trading

Apr 27
     

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


All times are GMT -4. The time now is 04:20 AM.

no new posts
Page generated 2017-03-24 in 0.06 seconds with 19 queries on phoenix via your IP 54.145.208.160