Dear all,
After sometime reading the manual, guides, new forum and old forum I am not able to find a solution to an (easy at first sight) experiment I was conducting.
I was able to nail down the problem to the following code:
// actual computation
TimeFrameSet( inMonthly );
Open_mo = O;
High_mo = H;
Low_mo = L;
Close_mo = C;
ATR14_mo = ATR(14);
WMA12_MO = WMA(C,12);
TimeFrameRestore();
// expand data
Open_mo_to_day = TimeFrameExpand( Open_mo , inMonthly, mode=expandLast );
High_mo_to_day = TimeFrameExpand( High_mo , inMonthly, mode=expandLast );
Low_mo_to_day = TimeFrameExpand( Low_mo , inMonthly, mode=expandLast );
Close_mo_to_day = TimeFrameExpand( Close_mo, inMonthly, mode=expandLast );
WMA12_mo_to_day = TimeFrameExpand( WMA12_mo, inMonthly, mode=expandLast );
ATR14_mo_to_day_exp_last = TimeFrameExpand( ATR14_mo, inMonthly, expandLast );
ATR14_mo_to_day_exp_first = TimeFrameExpand( ATR14_mo, inMonthly, expandFirst );
ATR14_mo_to_day_exp_point = TimeFrameExpand( ATR14_mo, inMonthly, expandPoint );
// graphical debugging
Plot( ATR14_mo_to_day_exp_last, "ATR14-last", colorWhite );
// show range result on exploration mode
Filter = Status( "rangefromdate" );
// highlight month changes
newMonth = Month() != Ref( Month(), 1 );
Color = IIf( newMonth, colorYellow, colorDefault );
// exploration output
AddTextColumn( FullName(), "Nombre", 1.0, 1);
AddColumn( Open_mo_to_day , "Open_mo_to_day" , 3.3, 1, Color);
AddColumn( High_mo_to_day , "High_mo_to_day" , 3.3, 1, Color);
AddColumn( Low_mo_to_day , "Low_mo_to_day" , 3.3, 1, Color);
AddColumn( Close_mo_to_day, "Close_mo_to_day", 3.3, 1, Color);
AddColumn( WMA12_mo_to_day, "WMA12_mo_to_day_last" , 3.3, 1, Color);
AddColumn( ATR14_mo_to_day_exp_last , "ATR14_mo_to_day_last" , 3.3, 1, Color);
AddColumn( ATR14_mo_to_day_exp_first, "ATR14_mo_to_day_first", 3.3, 1, Color);
AddColumn( ATR14_mo_to_day_exp_point, "ATR14_mo_to_day_point", 3.3, 1, Color);
The question I thought was easy to solve was:
What happened if I run an exploration on the previous code on Daily or Monthly period?
My first feeling was that the result will be the same as I am computing everything in a Monthly timebasis indistinctly of the time period (daily / monthly) set on the exploration.
Lights and shadows:
Using the Explorer as a debugger:
- I can verify that Open, High, Low, Close values do not change when you run a daily or monthly exploration. That´s very good.
- If I use a WMA() indicator or a MA() indicator the results do not change either. That´s very good.
- Using the ATR() indicator (the one I was interested in
), the results change, when running the exploration on daily/monthly basis. That´s bad!.
Using a graphical debugger:
- Output does not change when you select the chart interval to daily or monthly. That´s a good point.
- The graphical result (daily/monthly) is equivalent as when you set the explorer to "daily" period.
So here I am wondering why the exploration results for this particular code (where the computations are mede on monthly basis) does change ¿?.
I would appreciate any help, hint or advice,
Thanks a lot in advanced,
Regards,