# Rotational trading questions



## xxx (24 October 2016)

Hi,
I would like to buy the best five stocks with rotational trading.
My question is: Is it possible to buy each stock with 10000 initial capital per trade? Is there an AFL code?


----------



## Gringotts Bank (24 October 2016)

*Re: rotational trading - initial capital*



xxx said:


> Hi,
> I would like to buy the best five stocks with rotational trading.
> My question is: Is it possible to buy each stock with 10000 initial capital per trade? Is there an AFL code?




PosQty = Param( "Number of Positions", *5*, 1, 20, 1) ; // 
SetOption( "InitialEquity", *50000* );
SetOption( "MaxOpenLong", PosQty );
SetOption( "MaxOpenPositions", PosQty );
SetOption( "WorstRankHeld", PosQty );
SetOption( "AllowPositionShrinking", True );
SetPositionSize( *100 / PosQty*, spsPercentOfEquity );
SetTradeDelays( 0, 0, 0, 0 );
SetBacktestMode( backtestRotational );


----------



## xxx (24 October 2016)

*Re: rotational trading - initial capital*



Gringotts Bank said:


> PosQty = Param( "Number of Positions", *5*, 1, 20, 1) ; //
> SetOption( "InitialEquity", *50000* );
> SetOption( "MaxOpenLong", PosQty );
> SetOption( "MaxOpenPositions", PosQty );
> ...





thank you for the code. It works.
Is there also a code that the money does not accumulate?
I would like to buy every month 5 stocks with inital capital of 50000 dollar.


----------



## xxx (24 October 2016)

*Rotational trading - set the size of buying stocks each month*

Hi,
I use rotataional trading and would like to buy every month the 5 best stocks. each stock with 10000 initial capital.
The next month I would like to buy again the 5 best stocks. each stock has 10000 initial capital.
Do you know an algoirthm?


----------



## Joe Blow (24 October 2016)

I've merged these two threads on rotational trading so we can keep the discussion in the one place.


----------



## xxx (25 October 2016)

Joe Blow said:


> I've merged these two threads on rotational trading so we can keep the discussion in the one place.




Is there a function like SetPositionSize () which says, that the programm should not buy again the same stock, if she already bought it the month before?


----------



## tech/a (25 October 2016)

Saw this advertised here on ASF.




Maybe this helps
Another opinion.
Which brings it back to the question
How do you determine the method of choosing
the best 5 stocks.


----------



## xxx (25 October 2016)

*set initial capital*

Hi,
I wrote an algorithm which says that I would like the 5 best stocks each month and sell them in the same month. I choose the 5 best stocks according to the performance.
What I would like to do now:
I would like to have in total 50000 equity capital. But for each stock 10000.
That means that I would like to buy every month 5 stocks with an equity capital of 10000 per stock. Next month when I buy it I would like to have the same.
Right now, the capital is accumulating. But I do not want that my algorithm accumulates.
The other thing is that I would like to say: If for example AAPL is in january under the 5 best ones and in february as well. I don't want to buy it again and the equity capital in total is 40000.
Is there anyone who could help me with this? 



SetPositionSize(50000,spsValue);
PosQty = Param( "Number of Positions", 5, 1, 20, 1); // name, MaxOpenPositions, MinShares,
SetOption( "InitialEquity", 50000 );
SetPositionSize(20,spsPercentOfEquity);
SetPositionSize(PosQty,spsNoChange);
SetOption( "MaxOpenLong", PosQty );
SetOption( "MaxOpenPositions", PosQty );
SetOption( "WorstRankHeld", PosQty );
SetOption( "AllowPositionShrinking", True );
Edit/Delete Message


----------



## tech/a (25 October 2016)

tech/a said:


> Saw this advertised here on ASF.
> 
> View attachment 68538
> 
> ...




So that's a no.

As for Rational Trading

If your searching for the 5 best stocks in a month
Then looking again in the next month
Wouldn't you want those stocks to be the ones you bought the month before?

The idea isn't as rational as you think.


----------



## xxx (25 October 2016)

tech/a said:


> So that's a no.
> 
> As for Rational Trading
> 
> ...




Well I want to buy the 5 best ones in the beginning of the month and sell them in the end of the month. 
Next month I would like to do the same.
Now if a stock is in january under the 5 best ones and in feburary I dont want to buy it again. I just want to keep it. This is working so far. My problem now is that I dont want to buy it again and the inital capital of this stock should be in february 0.


----------



## tech/a (25 October 2016)

Your missing my point.
Carry on.


----------



## xxx (25 October 2016)

tech/a said:


> Your missing my point.
> Carry on.




I can not open the post.


----------



## tech/a (25 October 2016)

xxx said:


> I can not open the post.




That's not what your missing.

This is what your missing

*



If your searching for the 5 best stocks in a month
Then looking again in the next month
Wouldn't you want those stocks to be the ones you bought the month before?


Click to expand...


*How are you determining the 5 best stocks?

Those that have made a new high every week for x weeks over the last month?
Those that have made the most gain in % last month.
Those that have made the most gain in $ terms over the last month.
Those that have outperformed an index by the most % in the last month.
Ad infinitum

Shouldn't you be trying to ANTICIPATE the next 5 stocks in the month BEFORE they appear so you can gain the advantage and profit which will be seen in hindsight at the end of the month---with absolutely no guarantee that they will be in that list in the month your trading them?

Your rational and Mine are wide apart.
You could be right and I'm probably wrong!


----------



## CanOz (25 October 2016)

tech/a said:


> That's not what your missing.
> 
> This is what your missing
> 
> ...




I think they're looking for code for a ranking system, based on momentum....or a momentum system based on ranking...lol


----------



## tech/a (25 October 2016)

CanOz said:


> I think they're looking for code for a ranking system, based on momentum....or a momentum system based on ranking...lol




Thanks for the clarification Can
Which momentum are they going to use?


----------



## CanOz (25 October 2016)

tech/a said:


> Thanks for the clarification Can
> Which momentum are they going to use?




I reckon they're looking for a ranking system, its written about in a book somewhere...lol....

The theory goes you buy the strongest x number of stocks and then periodically re-rank them and adjust your portfolio accordingly....i believe Nick has a similar system. Its one of the most robust systems i've come across actually. You can even add a fundamental filter i believe....


----------



## tech/a (25 October 2016)

CanOz said:


> I reckon they're looking for a ranking system, its written about in a book somewhere...lol....
> 
> The theory goes you buy the strongest x number of stocks and then periodically re-rank them and adjust your portfolio accordingly....i believe Nick has a similar system. Its one of the most robust systems i've come across actually. You can even add a fundamental filter i believe....




Is this one of those " known" methods which has no solid test results backing it up?
Just Chinese whispers of return


----------



## CanOz (25 October 2016)

tech/a said:


> Is this one of those " known" methods which has no solid test results backing it up?
> Just Chinese whispers of return




Nah, its solid, i just don't have the results in front of me. Its momentum, trend following. Radge went to great lengths to code it, it was pretty difficult from memory...for Amibroker. The principles are well written, peer reviewed.


----------



## tech/a (25 October 2016)

CanOz said:


> Nah, its solid, i just don't have the results in front of me. Its momentum, trend following. Radge went to great lengths to code it, it was pretty difficult from memory...for Amibroker. The principles are well written, peer reviewed.




Ok
Sounds rational


----------



## xxx (25 October 2016)

CanOz said:


> Nah, its solid, i just don't have the results in front of me. Its momentum, trend following. Radge went to great lengths to code it, it was pretty difficult from memory...for Amibroker. The principles are well written, peer reviewed.




initial equity defines the starting equity for the whole test.
Then - the capital in the subsequent months will depend on my gains/losses from previous trades.

But I want that the capital in the subsequent months will not depend on my gains/losses from previous trades.

Do you have an idea for this?


----------

