Get current 10 minutes candle and last 10 minutes candle
#1
Question 
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!
  Reply
#2
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:

Code:
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;
}
  Reply
#3
Great! Thank you! Looking forward to guides and videos
  Reply
#4
In the meantime: if you have other questions like this feel free to ask them Smile
  Reply


Forum Jump:


Users browsing this thread: