[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Refs outside of selected date range?



PureBytes Links

Trading Reference Links

I look at your formula and you are just asking for the previous Highest High of the close in the past 20 periods. This will only take 1 day since you only need yesterday to satisfy this argument. With 2 days of data, yesterday will be the highest high in the past 20 days (since you don't have 20 days yet). Try it with MA or EMA and you won't get data until the 1st day after the MA period, day 21 if using a 20 day MA.

Terry

sebastiandanconia wrote:
Actually, in a related situation, this formula:

pds = Param("Periods", 20, 6, 252, 1); 

DonchianUpper =Ref(HHV(C,pds),-1);
DonchianLower = Ref(LLV(C,pds),-1);

does NOT start to plot 21 days after the first bar of the data, but 
starts with the second bar.  In fact, the upper and lower channels 
BOTH start with the close of the second bar.  In my MS program such a 
channel wouldn't begin to plot until there was the necessary number 
of periods to calculate the indicator.

I don't view this as a bug but I would like to know why and how it 
happens, along with a method for compensating (when appropriate).


Luck to all,

Sebastian

--- In amibroker@xxxxxxxxxxxxxxx, Terry <MagicTH@xxxx> wrote:
  
I don't know the answer to your question, but remember that 
    
indicators 
  
require time to stablize and AB automatically gets as many previous 
    
bars 
  
as necessary to do so. For example, you will need 100 bars to get 
MA(C,100). If you don't use pre-existing bars, the value of the 
    
array 
  
will be either null or incorrect until 100 bars of data exist.

I do know if you check the equity curve there is no data before the 
start date of your test regardless of how much data you have in 
    
your 
  
database.

Terry

onlyobsession2k3 wrote:

    
How come when I choose to view a specific date range in the auto-
analyzer and then Ref() outside of that range I don't get null 
      
values?
  
For example if I have:
Buy = 1;
Test = Ref(Buy,-1);

Then I would expect on the very first bar of my date range 
      
that "Test" 
  
would NOT be 1, but it is. It seems to grab the data from the 
      
previous 
  
bar. How can I get it to treat that first bar like there is no 
      
previous 
  
data whatsoever?

Thanks,

Joel
 

      





------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




  


Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





Yahoo! Groups Links