Re: [amibroker] Re: Help with Rotational Trading System code.

 

On the side note: why are you using 50 - RSI() not 100 - RSI() if you want only go long. From my experience Amibroker takes absolute values of PositionScore, so if RSI is 90 it's 50 - 90 = - 40 and then it's treated like it was 40 (the same value as if RSI was 10).

On Fri, Apr 29, 2016 at 1:17 AM, 'Bruce Wood' bruce.wood@bigpond.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

Hi Folks,
 
I said in an earlier post, that the solution suggested by Aron was successful. Unfortunately that is not completely correct!
 
 
The PositionScore coding Aron suggested was:
 
PositionScore = 50 – RSI() AND Close > 40;     (Only select Stocks with a Closing Price of $40 or above)
 
This worked perfectly in my back-test.
 
 
However, my minimum price rule is based on cents, not dollars, consequently, the code was amended to:
 
PositionScore = 50 – RSI() AND Close > 0.40;
 
This back-testing does not work! The back-test results are:
 
Only 4 trades (the first four alphabetical stock codes in the watch-list)
These four selections are open trades commencing from the back-test start date, to the current date.
 
Obviously the back-test ranking signals and rotations are not working?
 
 
 
Marcin,
 
This Trading System will only have long positions.
 
The code you suggested - PositionScore = (50 – RSI() AND C > 0.50;
 
The same outcome as above. I am not sure why this code works OK for Dollars, but not for cents???? If anyone has any ideas on the reason, I would be keen to understand why it does not work?
 
 
The other code you suggested:
 
PositionScore = IIf(C . 0.5, 100-RSI(), 0);
 
This code is looking promising! I will spend more time on this today.
 
Thanks again everyone for your help!
 
Best regards
Bruce W.
 
 
Sent: 29 April, 2016 4:30 AM
Subject: Re: [amibroker] Re: Help with Rotational Trading System code.
 
 

1.  use 100 - RSI() if you don't want to short, negative PositonScore values are tricky.
 
2. I would rather write (50 – RSI ()) AND C > 0.50 or try iif(C  > 0.5, 100-RSI(), 0);
 
 
 
On Thu, Apr 28, 2016 at 2:58 PM, 'Bruce Wood' bruce.wood@bigpond.com [amibroker] <amibroker@yahoogroups.com> wrote:
 
Hi Marcin,
 
Thank-you again for providing your thoughts.
 
If I use a typical coding for PositionScore (Example shown in AB 6.00 User's Guide – page 663).
 
PositionScore = 50 – RSI ();
 
Over my back-test period, I get 173 trades taken into the Portfolio (including stocks under 50 cents).
 
If I change the code to:
 
PositionScore = 50 – RSI () AND C > 0.50;
 
The back-testing does not work. The back-testing has picked-up the first five alphabetical stock codes in the Watchlist, (I have five positions) and these five stocks remained as open trades for the full term of the back-test (Approx 64 months) . (PositionScore and rotation is obviously not working!)
 
Any other ideas?
 
Many thanks and best regards
Bruce W.
 
 
Sent: 28 April, 2016 10:20 PM
Subject: Re: [amibroker] Re: Help with Rotational Trading System code.
 
 
I mean something like (if I understood you problem correctly)
 
PositionScore = iif(C > 0.5, PositionScore, 0);
 
or
 
PositionScore = PositionScore AND C > 0.5;
 
Of course you should set PositonScore to some value before.
 
best
 
 
 
On Thu, Apr 28, 2016 at 2:09 PM, 'Bruce Wood' bruce.wood@bigpond.com [amibroker] <amibroker@yahoogroups.com> wrote:
 
Hi Marcin,
 
Thank-you for your advices.
 
Just to clarify:
 
The first suggestion was to to edit the Watch-list, and exclude any stocks under the price requirement (50 cents). I don't see this to be a practical solution for back-testing, given the number of stocks, and the duration (years) of the back-test period.
 
Consequently, I need the code to exclude a stock if the price of the stock is 50 cents or lower. What you have suggested by having a value of "0" for stocks lower than 50 cents would probably work, however I do not know how to code that in the PositionScore coding?
 
I want the back-testing to exclude these low value stocks, as well not buying these stocks into the Portfolio. (Back-testing results should accurately reflect actual trading outcomes).
 
Any help would be appreciated.
 
Best regards
Bruce
 
 
Sent: 28 April, 2016 6:50 PM
Subject: Re: [amibroker] Re: Help with Rotational Trading System code.
 
 

Bruce,
 
So you don't want to exclude low value stocks from backtesting, but only from buying. Assigning PositionScore = 0 to stocks with C < 0.5 should do it.
 
best regards
 
On Thu, Apr 28, 2016 at 8:06 AM, 'Bruce Wood' bruce.wood@bigpond.com [amibroker] <amibroker@yahoogroups.com> wrote:
 
Hi Adam,
 
Thank-you for your advices.
 
My intention would be to trade a basket of stocks in an Index, and during my back-test periods, it may happen that a stock may move to my "exclusion zone" (Closing Price of 50 cents or under). If the stock again recovers above 50 cents, it would again be eligible to enter the portfolio. That is why I would like the Trading System code to manage this price condition, rather having to pro-actively maintain watch-lists throughout back-test periods (years and 300 stocks).
 
Thanks again, and best regards
Bruce W.
 
Sent: 28 April, 2016 3:46 PM
Subject: [amibroker] Re: Help with Rotational Trading System code.
 
 

Hi Trendchaser

 
I think the easiest way is to set up a watchlist with the high value stocks that you want included in the rotational trading system.
 
Then select FILTER and select the WATCHLIST you set up to backtest.
 
I am testing rotational systems and have watchlists set up for industries, regions, commodities, market capitalisation and mixtures of the above.
 
Regards Adam


 
--
Marcin Jagodziński


 
--
Marcin Jagodziński


 
--
Marcin Jagodziński




--
Marcin Jagodziński

__._,_.___

Posted by: =?UTF-8?Q?Marcin_Jagodzi=C5=84ski?= <marcin.jagodzinski@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (13)

Check out the automatic photo album with 1 photo(s) from this topic.
bgjjejde.png

Upgrade your account with the latest Yahoo Mail app
Get organized with the fast and easy-to-use Yahoo Mail app. Upgrade today!

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


.

__,_._,___


EmoticonEmoticon