Hi all,
       i know i'm at beginner levels but i just wanted to give my feed back to those that helped me,,,and have to admitt i'm still learning the code and taking bits from here n there without fully understanding it all,, but i've got my 3 day swing exploration working at this stage and it kinda feels good :) ,,,
 
i've now subscribed to premium data eod for the asx and usa stocks i explore one of the cfd watch lists ,i've also noticed i can explore with n=1 function or a 5 day range which returns more scans with a little noise.
 
   there's probably easier ways of doing it but here it is,,any comments welcome.
cheers
  Paul

Filter = C > 1 AND C < 20 //looking for bang for buck value

AND RecentHi3Is20=Ref(H,-3)==HHV(H,20) //looking for 3 day hi to be highest in 20days

AND recenthi= Ref(H,-1)< Ref(H,-2) //looks for 3 lower highs

AND RecentHi=Ref(H,0) < Ref(H,-1)

AND MAproperOrder=IIf(MA(C,18)>MA(C,40),1,0) //trend definer

AND MAproperOrder=IIf(MA(C,40)>MA(C,41),1,0) //attempt to ensure 40ma pointing up

AND recentLow=Ref(L,0) < Ref(L,-1) //trying to ensure a new high creates an isolation

AND recentlow=Ref(L,0) < MA(C,18); //trying to ensure some reversion to the mean

AddColumn (C,"close"); //needed a column for exploration

AddColumn (V,"Volume"); //add on bit of fun.

 

 

 

       

Paul,

The failed to initialize a variable error……………In most cases it seems that Amibroker requires that you give the moving averages a variable name or use a logical iif statement to assign a value from a comparison.

Try this for the most straightforward way I can think of.

T=MA(C,20);

F=MA(C,40);

Filter=T>F;

This should do an exploration for that one factor on whatever list you have selected or filtered on the left side of the automatic analysis window.

Filter statement must come after defining MA proper order.  Code isn’t smart enough to look forward to see that you will define MAproperOrder in a later statement.

Filter= MAproperOrder >0;

MAproperOrder = iif(MA(C,20)>MA(C,40),1,0) ;     ………….. this is the logical iif statement to get MAproperOrder defined.

So you can try it this way.  You have to use an iif (2 i’s in iif) statement in order to combine the logic the way you wanted to and get your variable defined with a value. You were writing a logical statement, so it requires the iif statement, I believe.  The iif statements are the same as Excel formula format.

MAproperOrder = iif(MA(C,20)>MA(C,40),1,0) ;

Filter= MAproperOrder >0;

Hope this helps – it’s hard jump starting any new programming language, but I can assure you that Amibroker is efficient with their code and it’s rational.  And it’s compact compared to some of the other systems.  I’m working to think like it thinks…….. it’s generally more logical than I am……. Hard on my brain some days.  I’m a rookie as well as you.  Takes a while and what I think will work, won’t necessarily.  And it seems that your code should work, but this probably will.  The pro’s here can make this stuff work with a lot of combined expressions, but I stick with one step at a time.

Mike


From: [EMAIL PROTECTED]ps.com [mailto:amibroker@yahoogroups.com] On Behalf Of paulradge
Sent: Sunday, October 15, 2006 1:28 AM
To: [EMAIL PROTECTED]ps.com
Subject: Re: [amibroker] mentor wanted

Hi Robert,

               thank you for your input and my apologies for my post being so confusing,,

i'm not going to pursue assembling such a basic swing filter any longer but my sincere thanks for your time,

all the best with your trading and interests

regards

Paul

It is hard for me to understand your question but if you want a signal that the high 3 days ago was the highest in the last 20 days, you might think about something like this:

RecentHi3IsHi20=ref(H,-3)==hhv(H,20);

Robert

paulradge <[EMAIL PROTECTED]com.au> wrote:

I've started reading the tutorials but i'm not finding what i want to see,,,

i'd like to put together a simple swing scan/explorer based on Oliver Velez
swing trading tactics,,,

a 20ma above a 40ma ,,the high of 3-5 days ago the highest high in 20 days
,,,the 3-5 days of down to have lower highs looking for a new higher high
for the buy with the stop under the last isolation low /pivotpoint

with ezyanalyser i can have all but 1 of those indicators done in
seconds,,,the 1 i can't have is the 20ma above the 40 ma,,for some reason
ezyanalyser looks at the ma of 20 days ago,,,and hence why i wanted
amibroker,,,with the bonus of everything else amibroker does,,,,not to
mention the company of some mind boggling posts from this user group.

alas learning this language is more complex than studying Bradley Cowan's
4th dimensional market geometry,,

hunting around through other filters in the library and reading the
tutorials,,,which are great but i'm not interestedin buying a ma cross over
or macd,,,nor in backtesting at this stage,,,but i do need your help or
someone to mentor me through this swing scan/explorer

this is where i'm at ,,i've tried pinching this from a swing scan in the
library but changed the ma values to what i want,,so i can atleast get part
of this swing filter together,,

MAProperOrder = (MA(c,20) > MA(c,40));
post this i get a "variable" error ,,,after some reading and looking through
other files i now have
Filter = MAProperOrder before the other line,,,that error has now moved to
error 29 ,,needs to be initialised,,,as i've mentioned in another post on
Gartleys ,,i've looked up error 29 and read the example but fail to
understand how that apply's to this situation also,,

next i need to be able to set the high of 3 days ago to be the highest in 20
days,,,anytips on where abouts in the tutorial i can read up on the language
used set this up please,,,,

regards
Paul


All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.

__._,_.___

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to