I can not see what you are looking for in your code. Applystop() is for exits not for entries. If you want to buy on a new high immediately after close price crosses your moving average the code should be smth. like this:
myAverage = .... Cond1 = Cross(Close, myAverage); Cond2 = ref(Cond1,-1); // returns 1 if cross above occurs in the previous bar Cond3 = High > ref(High,-1); // returns 1 if new high is established buy = Cond2 and Cond3; BuyPrice = ref(high,-1) + ticksize; // buy 1 tick above previous High // your exit logic using ApplyStop() here....... [email protected] wrote: > Aaron > > Thanks much for the reply - Appreciated. > > The reason cross was not used was because when the condition was met, i.e. C> > than moving average I wanted to initiate a buy stop above the high that > occurred on the day of the cross. I'm sure that was not apparent :-) > > Sorry for the confusion. > > Thanks again > Bill > > > > ------------------------------------ > > **** IMPORTANT PLEASE READ **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > TO GET TECHNICAL SUPPORT send an e-mail directly to > SUPPORT {at} amibroker.com > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > http://www.amibroker.com/feedback/ > (submissions sent via other channels won't be considered) > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > Yahoo! Groups Links > > > >
