Get current 10 minutes candle and last 10 minutes candle
hi, I'm trying to write a custom strategy, and I wonder how can I get this 10 minutes candle and last 10 minutes candle.

if this question is  duplicate, pls give me some  reference, thank you!
I'm working on some strategy guides and some videos. What you want to do is "store" the previous candle in your strategy like so:

strat.check = function(candle) {
  this.currentCandle = candle;

  // use the current and previous one
  if(this.currentCandle.close < this.previousCandle.close) { ... etc }
  // call the current candle previous one so the next time
  // the check function runs you can still access it
  this.previousCandle = this.currentCandle;
Great! Thank you! Looking forward to guides and videos
In the meantime: if you have other questions like this feel free to ask them Smile

Forum Jump:

Users browsing this thread: