KO
Topics
Replies
kouekam18alain
02 Dec 2024, 00:35
( Updated at: 02 Dec 2024, 06:51 )
RE: I can't use the Bars.ClosePrices.Last(1) line of code in the onTick method from the plugins
firemyst said:
What's the error you receive?
Here's the error I get
I can't implement the onTick method and get the price of previous bars because the related lines of code are marked in red.
protected override void OnTick() // I have an error on onTick
{
double v1 = Bars.ClosePrices.Last(1); // I have an error on Bars.ClosePrices
double v2 = Bars.OpenPrices.Last(2); // I have an error on Bars.OpenPrices
Print(v1);
}
@kouekam18alain
kouekam18alain
08 Dec 2024, 18:30 ( Updated at: 09 Dec 2024, 06:21 )
RE: I can't use the Bars.ClosePrices.Last(1) line of code in the onTick method from the plugins
PanagiotisCharalampous said:
There is an error on this line :
Print(_bars.ClosePrices.Last(1));
_bars doesn't know the methods or ClosePrices.Last and therefore fails to call them.
_bars. doesn't call any method, hence the error
@kouekam18alain