User error, was: Multi Timeframe Explorer - Exploring interval is lowest TF

Gurus,
I am trying to code a simple code to find the stock which is crossing over Previous Days Highest or Lowest points. I am sure this is discussed in past, but could not find a relevant thread which exactly answers my query. So I am trying to breakdown my understanding of the AFL APIs for MTF functions which I am using:

  1. My exploring time is 5mins, and I am exploring only on recent day (today), does that invalidate my code for finding yeserday's DH or DL?

  2. I tried to use first TimeframeSet(inDaily). then Find yesterday high by:
    PDH = Ref(H,-1)
    TimeframeRestore();

Then I used
Filter = Cross(C,TimeframeExpand(PDH,inDaily);
Also to note what value of PDH is actually captured, I printed it on the exploration output using Addcoulmn

What I noticed, it is taking incorrect values of PDH., exploration TF 5 mins, recent days.

  1. The moved to an alternative to see if this helps
    I get the previous days high with below function:

PDH = TimeFrameGetPrice("H", inDaily, -1);

Filter = Cross(C,PDH);

Now, again scanning /exploring interval = 5 mins, selected date range = today

Explorer returns wrong result printed PDH value is also wrong
Scan, however, shows correct crossover points, but in past days, not for today

Is there a simple way to play with higher timeframe, like is daily (attributes like DH, ADX etc for my decision flow) while exploring from lower time frame (say 5 mins), and I am only interested in recent days validations of the condition set.

Any sample exploration code will suffice. I am new to AFL, but a programmer for las 15 odd years by profession, hopefully will grasp it quicker, no bragging.

Never mind, got this sorted myself. My code was fine, I was probably checking a wrong chart. This bit what worked for me Idea was to find stock opening lower than PDL or crossing below PDL - to find the select watchlist for the day to scalp in opportune moment.

_SECTION_BEGIN("Lower than Yesterday");
PDL = TimeFrameGetPrice("L",inDaily,-1); // Previous Day Low
DH = TimeFrameGetPrice("H",inDaily,0);  // Day High till now
Filter = DH < PDL OR Cross(PDL,C) ;  //Stock opened lower below PDL and never reclaim PDL level OR open higher to PDL but moved lower
AddColumn(PDL, "Prev DLow");
AddColumn(C,"CrossOver Closing Value");

_SECTION_END();

chart2
Chart1

There aren't no bugs in AmiBroker.
All TimeFrame* function work perfectly fine and output expected results in regards to each different setting.

Documentation:
Multi timeframe support is explained here .
All related functions and function arguments:
TimeFrameSet(), TimeFrameRestore() and TimeFrameExpand() as well as TimeFrameGetPrice().
KB provides examples also. As well as this forum.


Besides please read here (if you haven't and if you have then please do so again)


1 Like

@Anid_007 Your user account isn't marked with License verified badge. Did you purchase AmiBroker license?

Only users with License verified badge are allowed to post on this forum.

So before posting, make sure you verify your license as explained here.

Topic closed until original poster proves license status