candle pattern on weekly bars

Posted By: sarmasboy

candle pattern on weekly bars - 08/23/19 10:10

Hello all. I was wondering if it's possible to have candle patterns recognized using the in-built functions on weekly candles? I am using BarPeriod and TimeFrame, but it still seems to draw candles as if they were based on a daily candle, rather than weekly. Here's my code:
Code
function run()
{
  StartDate = 2010;
  EndDate = 2019;
  LookBack = 10;
  BarPeriod = 1440;
  TimeFrame = frameSync(7);
  set(PLOTNOW);
  
  if(CDLEngulfing()!=0) {
	  printf("\nEngulfing at %s", strdate("%Y-%m-%d %H:%M", wdate(0)));
  }
  plot("Engulf",CDLEngulfing(),NEW+BARS,BLUE);

}
Posted By: AndrewAMD

Re: candle pattern on weekly bars - 08/23/19 13:20

Bars and frames are two different things. Use frame() to check for a new frame. Your series() call will only add a new element when there is a new frame.

So yes, you want a weekly frame.
© 2024 lite-C Forums