Hi Joe,
I have gone over your most helpful method of analyzing Exrem() and believe/hope i have a full understanding of it.At this point,I do believe the definition in the manual is partially incorrect,there is a "bug" or I am a numnut.
I think my initial code illustrates the issue i am having as the trades are far less frequent.
Buy=Cross(Close,MA(Close,21));
Sell=Cross(MA(Close,200),Close);
Sell=Cross(MA(Close,200),Close);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
PositionSize=-10;
Sell=ExRem(Sell,Buy);
PositionSize=-10;
For simplicity sake,i was running this code on Goog with 3/10 as the starting date.
If i dont code Exrem,a buy signal is taken on the MA21 cross over on 3/24.The trade arrows verify that as does the backtest as well as explore.
HOWEVER,if i code with Exrem,the earlier MA21 crossovers are IGNORED until 6/1/2006.This is due to the fact that Buy signals with Exrem() will not be taken until the Sell signal takes place.GOOG crossed the 50 day MA on 5/12..In Ami terms(and i am not a comoter guy) unless Array2=True,there will not be no trades taken..The manual states
"removes excessive signals:
returns 1 on the first occurence of "true" signal in Array1
then returns 0 until Array2 is true even if there are "true" signals
in Array1 "
returns 1 on the first occurence of "true" signal in Array1
then returns 0 until Array2 is true even if there are "true" signals
in Array1 "
I have not found this to be true,and as i said I am a computer numnut.I still maintain that the manual should read
"returns 0 on the first occurence of "true" signal in Array1
until Array2 is true even if there are "true" signals in
Array1"
Tomasz,if you are out there can you prove me wrong...please!!!!
thanks,
Allan
"returns 0 on the first occurence of "true" signal in Array1
until Array2 is true even if there are "true" signals in
Array1 "
----- Original Message -----
From: Joe Landry <[EMAIL PROTECTED]>
Date: Monday, July 31, 2006 9:22 am
Subject: Re: [amibroker] Exrem help
To: [email protected]
> Allan
> This may be elementary to you but this is how I find out how
> these functions
> work.
> (or I plot the signals out or use TRACE). I don't doubt they
> work but it
> helps with
> my understanding
>
> CROSS will give you an impulse, that is - a one(1) at the time
> of crossing.
> So to show
> what EXREM does I used moving average cross oversm which will
> give you 1's
> for
> the number of bars the conditions are met. Your criteria of
> 200 day MA
> just didn't give me that many hits so I changed it to fifty to
> demonstrate.
> Maybe it was the ticker I was
> using INTC.
>
> Try this out on your ticker and see if this helps, that is set
> range to 252
> bars, single issue
> in the filter area, and do an EXPLORE.
>
> Best regards
> Joe
>
>
> BuyTemp= Close> MA(Close,21);
>
> SellTemp=MA(Close,50)>Close;
>
> Buy = BuyTemp;
>
> Sell = SellTemp;
>
> Buy=ExRem(Buy,Sell);
>
> Sell=ExRem(Sell,Buy);
>
> Filter = 1;
>
> AddColumn(BuyTemp,"All Buy Signals");
>
> AddColumn(Buy,"BUY SIGNAL");
>
> AddColumn(SellTemp,"All Sell Signals");
>
> AddColumn(Sell,"SELL SIGNAL");
>
>
>
> ----- Original Message -----
> From: "matrix10014" <[EMAIL PROTECTED]>
> To:
> Sent: Monday, July 31, 2006 7:40 AM
> Subject: [amibroker] Exrem help
>
>
> > Hi all,
> >
> > Whenever I get to the point of thinking I understand Exrem(),the
> > backtest results prove me wrong....I think it has something to do
> > with my interpertation of this definition from the manual
> >
> > "removes excessive signals:
> > returns 1 on the first occurence of "true" signal in Array1
> > then returns 0 until Array2 is true even if there are "true" signals
> > in Array1 "
> >
> >
> > here is my test code.
> >
> > Buy=Cross(Close,MA(Close,21));
> > Sell=Cross(MA(Close,200),Close);
> > Buy=ExRem(Buy,Sell);
> > Sell=ExRem(Sell,Buy);
> > PositionSize=-10;
> > //PositionScore=100-RSI();
> > ApplyStop(0,1,Optimize("maxstop",1,2,26,2),2,False,1);
> >
> >
> >
> >
> > It is clear from my backtests,that AMI ignores the first buy signal
> > until the Sell criteria is met.As array1 is my Buy MA cross,I would
> > have expected to be long on the very first MA cross(array1 =1) and
> > then it would be reset to zero and no buy signals could be taken
> > until array2=1(close crosses below Ma).By the user manuals
> > definition,I should be long on the first occurence,and it is not
> > happening.I thought that should I be stopped out to due a max loss
> > stop,all Buy signals would be ignored until my "SELL" criteria is
> > met...
> >
> >
> > Would someone simply explain what Exrem() does,and what the logic
> > is?? Why is it ignoring the first buy signals until the Sell
> > criteria is met??As far as I can tell,the definiton should be...
> >
> > "returns 0 on the first occurence of "true" signal in Array1
> > until Array2 is true even if there are "true" signals in
> Array1 "
> >
> > Can someone plaease lead me from the path of darkness???
> >
> >
> > Just checking...In AA under the range options,am I correct
> that for
> > the selection of N last days,DAYS is calender days and not trading
> > days.So N=252 is NOT 1 year of data.This seems to be my
> finding when
> > i select the range option and use a 1 year range to verify...
> >
> > How do I simply click on a trade in AA and have a chart pop up??
> >
> > Any and all help welcome
> >
> > Allan
> >
> >
> >
> >
> >
> >
> >
> > 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
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
__._,_.___
until Array2 is true even if there are "true" signals in
Array1 "
----- Original Message -----
From: Joe Landry <[EMAIL PROTECTED]>
Date: Monday, July 31, 2006 9:22 am
Subject: Re: [amibroker] Exrem help
To: [email protected]
> Allan
> This may be elementary to you but this is how I find out how
> these functions
> work.
> (or I plot the signals out or use TRACE). I don't doubt they
> work but it
> helps with
> my understanding
>
> CROSS will give you an impulse, that is - a one(1) at the time
> of crossing.
> So to show
> what EXREM does I used moving average cross oversm which will
> give you 1's
> for
> the number of bars the conditions are met. Your criteria of
> 200 day MA
> just didn't give me that many hits so I changed it to fifty to
> demonstrate.
> Maybe it was the ticker I was
> using INTC.
>
> Try this out on your ticker and see if this helps, that is set
> range to 252
> bars, single issue
> in the filter area, and do an EXPLORE.
>
> Best regards
> Joe
>
>
> BuyTemp= Close> MA(Close,21);
>
> SellTemp=MA(Close,50)>Close;
>
> Buy = BuyTemp;
>
> Sell = SellTemp;
>
> Buy=ExRem(Buy,Sell);
>
> Sell=ExRem(Sell,Buy);
>
> Filter = 1;
>
> AddColumn(BuyTemp,"All Buy Signals");
>
> AddColumn(Buy,"BUY SIGNAL");
>
> AddColumn(SellTemp,"All Sell Signals");
>
> AddColumn(Sell,"SELL SIGNAL");
>
>
>
> ----- Original Message -----
> From: "matrix10014" <[EMAIL PROTECTED]>
> To:
> Sent: Monday, July 31, 2006 7:40 AM
> Subject: [amibroker] Exrem help
>
>
> > Hi all,
> >
> > Whenever I get to the point of thinking I understand Exrem(),the
> > backtest results prove me wrong....I think it has something to do
> > with my interpertation of this definition from the manual
> >
> > "removes excessive signals:
> > returns 1 on the first occurence of "true" signal in Array1
> > then returns 0 until Array2 is true even if there are "true" signals
> > in Array1 "
> >
> >
> > here is my test code.
> >
> > Buy=Cross(Close,MA(Close,21));
> > Sell=Cross(MA(Close,200),Close);
> > Buy=ExRem(Buy,Sell);
> > Sell=ExRem(Sell,Buy);
> > PositionSize=-10;
> > //PositionScore=100-RSI();
> > ApplyStop(0,1,Optimize("maxstop",1,2,26,2),2,False,1);
> >
> >
> >
> >
> > It is clear from my backtests,that AMI ignores the first buy signal
> > until the Sell criteria is met.As array1 is my Buy MA cross,I would
> > have expected to be long on the very first MA cross(array1 =1) and
> > then it would be reset to zero and no buy signals could be taken
> > until array2=1(close crosses below Ma).By the user manuals
> > definition,I should be long on the first occurence,and it is not
> > happening.I thought that should I be stopped out to due a max loss
> > stop,all Buy signals would be ignored until my "SELL" criteria is
> > met...
> >
> >
> > Would someone simply explain what Exrem() does,and what the logic
> > is?? Why is it ignoring the first buy signals until the Sell
> > criteria is met??As far as I can tell,the definiton should be...
> >
> > "returns 0 on the first occurence of "true" signal in Array1
> > until Array2 is true even if there are "true" signals in
> Array1 "
> >
> > Can someone plaease lead me from the path of darkness???
> >
> >
> > Just checking...In AA under the range options,am I correct
> that for
> > the selection of N last days,DAYS is calender days and not trading
> > days.So N=252 is NOT 1 year of data.This seems to be my
> finding when
> > i select the range option and use a 1 year range to verify...
> >
> > How do I simply click on a trade in AA and have a chart pop up??
> >
> > Any and all help welcome
> >
> > Allan
> >
> >
> >
> >
> >
> >
> >
> > 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
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
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
SPONSORED LINKS
| Investment management software | Real estate investment software | Investment property software |
| Software support | Real estate investment analysis software |
YAHOO! GROUPS LINKS
- Visit your group "amibroker" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
