I am fairly new to Wealthlab Pro. I wish to create a function to evaluate a bar (creating a function so I can re-use the code). But, in declaring the function I must identify the variable I am passing to it.
public bool CandleStick_Eval( [bar type?????] bar_eval ) {
The data I wish to pass to the function is a single bar. Bar has various definitions, such as Close and Open. The problem I'm having is I do not know what datatype to declare for the bar variable that I wish to pass to the function. Any advise or direction is appreciated.
Thx,
Dave
Size:
Color:
The Bars
class, along with some methods, mechanisms (e.g. Bars.Cache) and custom data series, contains a collection of DT+OHLCV values.
1. If your function is called inside the main (trading) loop:
Pass the whole Bars object and the bar number (e.g. i) to your function, then get the associated OHLCV values on that bar by using the indexer:
CODE:
Please log in to see this code.
2. If your function is designed to work outside of the main (trading) loop:
Pass the whole Bars object and the bar number to your function, then loop through the collection to get associated OHLCV values on that bar.
Size:
Color: