Glad to hear that was the only problem.
Will have a look at Dynamic Stops and  'Monte Carlo Permutation test' when
time permits.

Bob

-----Original Message-----
From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] Behalf
Of thomasdrewyallop
Sent: Sunday, February 18, 2007 6:50 PM
To: amibroker@yahoogroups.com
Subject: [amibroker] Re: Dynamic Stops

Yes of course Bob that is the problem and it explains why i kept
getting a whole bunch of 1's in the buy array after an market entry.
Programming for 20 years and still making the euivalence vs assignment
mistake.

Thanks for bringing fresh eyes to this.

Regards,

Drew

--- In amibroker@yahoogroups.com, "Bob Jagow" <[EMAIL PROTECTED]> wrote:
>
> I didn't check whether fixing the error in line 4 does the trick.
> Buy = Cross(C, movingAverage);
> stopPrice=0;
> temp1=0;
> if(Buy==1) <=
>
>
> -----Original Message-----
> From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED]
Behalf
> Of thomasdrewyallop
> Sent: Saturday, February 17, 2007 4:43 PM
> To: amibroker@yahoogroups.com
> Subject: [amibroker] Dynamic Stops
>
> I want to set a stop on a buy signal calculated using one formula and
> then change the the stop on subsequent bars using another formula. I
> have tried the following:
>
> Buy = Cross(C, movingAverage);
> stopPrice=0;
> temp1=0;
> if(Buy=1)
>         {
>                 stopPrice=BuyPrice-(mmstp*exitAtr);
>         }
>                 else
>                         {
>                                 temp1 =(High - (stpParmA *exitAtr)) -
> stopPrice;
>                                 if (temp1[i] > 0.0)
>                                         {
>                                                 stopPrice=stopPrice +
> (stpParmB*temp1);
>                                         }
>                                 else
>                                         {
>                                                 stopPrice=stopPrice;
>                                         }
>                         }
> This does not work. The initial stop is set OK but the stops on
> subsequent bars are not changed.
>
> Any help would be much appreciated.
>
> Best regards,
>
> Drew Yallop
>
>
>
> 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
>




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




Reply via email to