Creating Bars Class for All Bar Data
Author: Panache
Creation Date: 1/16/2016 9:52 AM
profile picture

Panache

#1
I'd like to have a void which analyzes at the data from two bars. Instead of having 12 inputs (Date, Open, High, Low, Close and Volume for each bar), I was hoping to be able to create a class for the bar data and only have two inputs.

CODE:
Please log in to see this code.


When I compile this, I get error CS0021: Cannot apply indexing with [] to an expression of type 'WealthLab.Bars'. Is there a way to do this?
profile picture

Eugene

#2
"Bars[0], Bars[1]..." imply that you have an array named "Bars" (a collection of Bars objects) which you do not as "Bars" is a Wealth-Lab type.
profile picture

Eugene

#3
You were probably looking to have something like this (w/o any error handling):

CODE:
Please log in to see this code.
profile picture

Panache

#4
I was really trying to do it the hard way. I thought I had to bring the Bars object into the void. All I needed to do is:

CODE:
Please log in to see this code.


This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).