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

[amibroker] Help with looping code for exploration



PureBytes Links

Trading Reference Links

This is exploration is run against the S&P 500 watch list using a 
trailing 1 year date range adjusted for a 20 day lead up period. 

I am trying to write an exploration that will check for the following:

Filter= RSILow == LLV(RSI(14),125);

I wan to add columns showing the highest high and lowest low  and 
the  HH LL spread since the filter event at T+5 T+10 T+15 and T+20.

HH5 = Ref(HighestSince(LLV(RSI(14),125) , H, 1 ) ,5);
LL5 = Ref(LowestSince(LLV(RSI(14),125) , L, 1 ) ,5);
R5 = HH5 - LL5;

HH10 = Ref(HighestSince(LLV(RSI(14),125) , H, 1 ) ,10);
LL10 = Ref(LowestSince(LLV(RSI(14),125) , L, 1 ) ,10);
R10 = HH10 - LL10;

HH15 = Ref(HighestSince(LLV(RSI(14),125) , H, 1 ) ,15);
LL15 = Ref(LowestSince(LLV(RSI(14),125) , L, 1 ) ,15);
R15 = HH15 - LL15;

HH20 = Ref(HighestSince(LLV(RSI(14),125) , H, 1 ) ,20);
LL20 = Ref(LowestSince(LLV(RSI(14),125) , L, 1 ) ,20);
R20 = HH20 - LL20;
  


For this code to work in an exploration across a date range I need a 
counter to track the Nth occurrence of the event per ticker for the 
HighestSinceand LowestSince ststments.  Is my approach sound or is 
their a better way to get the results I want?  

I am a novice programmer learning how to write loops.  I am 
completely stuck and do not know how to writ a counter for the Nth 
occurrence of the event.   

Any help would be greatly appreciated.




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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/