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

Market Analysis w/Dave Forss @ IQFeed

Apr 25
 

Introducing iSystems with Stage 5 Trading

Apr 27

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

May

Prototyping Python Strategies (part 2) w/Ran Aroussi

Elite only

Ask Me Anything w/Raymond Deux @ NinjaTrader

May 3

An Afternoon with FIO member Softsoap

Elite only
 

Machine Learning & Data Mining Bias w/Kris Longmore @ Robot Wealth

Elite only

Brannigan Barrett (TBA)

Elite only

FIO member Gomi (TBA)

Elite only

FuturesTrader71 (TBA)

Elite only

EasyLanguage Programming w/Chris @ ABC Trading Group

Elite only

Portfolio Diversification w/Brendon Delate

Elite only
     

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 01:46 PM.

no new posts
Page generated 2017-04-23 in 0.08 seconds with 20 queries on phoenix via your IP 54.158.39.172