ActiveTrader 2010-02 | RSI scale-out system [Rev.C]: Positions are inconsistent
Author: pubx101
Creation Date: 3/8/2018 3:15 AM
profile picture

pubx101

#1
I back tested strategy 'ActiveTrader 2010-02 | RSI scale-out system (Rev.C)' (without any changes) on DataSet 'S&P 500' with same start date and DIFFERENT end date, and found inconsistent results:

1. Set Start date 1/1/2017, end date 2/22/2018 (Fig Pos0222), at the end there is a position:

Long KIM 601 1/30/2018 .... Open

2. Set Start date 1/1/2017, end date 3/07/2018 (Fig Pos0307), and Position are different on 2/22/2018 now:

Long KIM 201 1/30/2018 .... 2/21/2018
Long FMC 36 1/24/2018 .... 2/26/2018
Long MET 67 2/1/2018 .... 2/26/2018
Long WMT 144 3/2/2018 .. OPEN

I don't think it is because of the strategy itself since I see this with different strategies.

Where are positions on FMC and MET from since they are not in the first test result list ?
Will it be the same if we run strategies in 'Strategy Monitor' at different dates?
What can I do to run the strategy to generate consistent results ?

profile picture

Eugene

#2
Clearly, the KIM trade in the 2nd run took the entire available cash. As the position size has almost tripled there was no room for the other trades.

I'd suggest to not use 100% equity with this system in a multi-symbol backtest. This prevents it from being able to scale out (up to 4 positions), effectively turning it into a single-position system. Notice how much greater is "Trades not included due to insufficient simulated capital" than the number of trades included (on the Trades tab).

For ideas and workarounds please review this FAQ: I'm using 100% Equity position sizing and strategy doesn't seem to use all capital and/or there are trades not included due to insufficient capital
profile picture

pubx101

#3
I tried with the overloading function, it works now. thank you.

Why the strategy doesn't scale out in 100% position? I should be able to invest all money on one stock and scale it out in 4 sales. (I have multiple datasets so the risk is reduced).
profile picture

Eugene

#4
QUOTE:
I should be able to invest all money on one stock and scale it out in 4 sales.

And this usually happens in a single-symbol backtest.
profile picture

pubx101

#5
I found another thing can't explain myself. I did same tests (with end date on 2/22 and 3/7 on SP500) and compared the results:

Last trade on 2/22,
Long AAPL 19 buy on 2/5/2018 ... sell on 2/14/2018

Last trade on on 3/7
Long MET 66 buy on 2/1/2018 .... sell on 2/26/2018


I tested with end date from 2/4 - 3/7: the last trade is AAPL with end date from 2/20 - 2/22 and the rest is MET.

What is the reason that the strategy had different results on different dates? Does WLP use look-forward method to adjust positions for better performance?

thanks
profile picture

Eugene

#6
At the risk of repeating, the reason is explained in my reply #2 above (last paragraph). Please refer to the FAQ / User Guide.

P.S. Something you might want to have a look at with regard to this system: RSI scale out system (Rev.C) in simulation mode

QUOTE:
Does WLP use look-forward method to adjust positions for better performance?

Unless you intentionally use Walk Forward Optimization, no.
profile picture

pubx101

#7
I understand that positions will be different with insufficient capital, but this is different case: the strategy picks different trades on the same (or close) trade date when you test with different end date. please check the screen shots I attached, the last trade AAPL vs MET in the screenshots.
profile picture

Eugene

#8
This might have to do with synchronization of external symbol data.
profile picture

pubx101

#9
What does it means? the tests are on the same data set and same start date, why the trades selected in simulation mode are different after? how do I trust the back test result then?

I ran the strategy again with end date 1/10/2018, 1/11 and 1/23, the screen shots are attached (don't know how to insert the image in the text).

the trades (on 1/11) from test results of 1/23 are changed from ESS to AIV and UDR. thanks
profile picture

Eugene

#10
1. Does your backtest account for the fact that S&P 500 has had new additions: BKNG (21 bars), DWDP (142 bars), BHF BHGE DXC etc.? (No.) You shift the date forward and BKNG starts trading.

2. Have you also run these tests in Raw Profit mode to avoid the impact of random selection of trades in case there are insufficient funds to enter with 25% capital on 500 symbols? (No.)
profile picture

pubx101

#11
The data set 'SP500' doesn't have the latest components and starting Capital is set to $20,000. I was developing my first strategy with WLP and found the problem and reproduced with strategy 'RSI scale-out system'.

This is my main point: I use simulation mode the test my strategies for performance (with limited capital, so can't be in Raw Profit mode), and I tested with the same data set and same configuration parameters. With same start date and different date, I expect that the results (trades and alerts) are consistent on the same dates among the tests, so I can really use the strategy for real trades. With different results I don't know if performance result from back test is real and how reliable it is, and can't follow it to make real trades (you can image I have 2 positions on day 1, and the strategy tells me I should have different position that was bought several days ago on day 3).

Where can I get documents for how WLP simulation mode works ( from a programmer point view, such as control flow, data flow etc) ?
Can you test the strategy and find out what is real reason ( I don't think it is the strategy itself, and it is not hard to reproduce the case) ?

thank you very much
profile picture

Eugene

#12
As you could see from the link I referred to in post #6 above, SplitPosition can be problematic in certain scenarios. This led to raising bug #7282 > SplitPosition() does not interact realistically in Portfolio Simulation Mode. This is still an open issue.

In this case let me recommend you a workaround: instead of using SplitPosition, rewrite your Strategy to create distinct multiple Positions upfront and close them on demand. Taking "ActiveTrader 2010-02..." for example, you'd create 4 instances of BuyAtMarket at the entry bar and simply unload one of them each time the RSI increases by 15 points. Voila.
profile picture

pubx101

#13
Which function should I use for buy and sell as you suggested ? specifying the buy size and size to sell ?
do you mean that the scenario may only happen for strategies with SplitPosition() function ? I will test other strategies without split . thanks
profile picture

Eugene

#14
You'll find answers to these general questions in the QuickRef, User and Programming Guides. If you have no other questions re: this particular Strategy which employs the SplitPosition method affected by a live bug I consider my mission done in this thread.
profile picture

KGo

#15
My take is multi-symbol portfolio backtest percent equity position sizing is not appropriate with this strategy and it also will not work when buying 4 fixed positions in lieu of splitting.

Percent equity positions will be entered up to the available cash so when 1 portfolio position sells (at 1/4 of original size) a single 1/4 size position may be bought to replace it. Conceptually a full position (4/4 size) must always be bought to enter a new trade.

The percent equity PosSizer must wait to enter until a full position size is exited (4 positions x 1/4 size each). Don't know of a way to do that!?
profile picture

Eugene

#16
I may be wrong but yesterday I think I might have noticed something I couldn't explain off the top of my head in a Raw Profit mode with this Strategy. Definitely its Rev.D should be taken from this thread and used with the Pyramiding PosSizer:

RSI scale out system Rev.C in simulation mode

As per his post #11, original poster's Strategy may be different from this RSI Scale Out system (and from this discussion thread as well). That's why I suggested him to try luck with buying 4 fixed positions.
profile picture

pubx101

#17
Thank you for your help. Can you give me a right direction ? Should I use PostionSize ?
profile picture

Eugene

#18
1.
Just to stay on the safe side: did you try assigning a Priority and an EntrySignal in your Strategy code (as per Rev.D of the system) and using it with the Pyramiding PosSizer? What was the outcome?
profile picture

Eugene

#19
2.
QUOTE:
Taking "ActiveTrader 2010-02..." for example, you'd create 4 instances of BuyAtMarket at the entry bar and simply unload one of them each time the RSI increases by 15 points. Voila.


Here's an example of what I meant:
CODE:
Please log in to see this code.
profile picture

pubx101

#20
I want to use priority and entryName. I ran your script in simulation mode with possize is 25%, In the results entry name is set to '3' for most trades, there is no single trade with entry name '1'. Since variable 'i' is a local variable and it should be updated. I am really confused now .

1. Is there any doc for the back test frameworks ?

2. The reason I asked if I should use PosSize: In your original RSI Scale out strategy, if I set position size to 25% in simulation mode and the start capital is 10000, then each Buy size is limited to $2,500. With four buys on the same stock, is it going to use all $10,000 on one single stock (each buy with $2,500) ?

3. I saw Rev.D for the strategy several times under different subject, but I can't find it under Strategy tab.

many thanks for your help.
profile picture

KGo

#21
QUOTE:
Percent equity positions will be entered up to the available cash so when 1 portfolio position sells (at 1/4 of original size) a single 1/4 size position may be bought to replace it. Conceptually a full position (4/4 size) must always be bought to enter a new trade.


Same issue in post #19. In portfolio simulation because capital is limited some entry dates will not open all 4 positions. Pyramid positions seems to help but does not resolve the issue. There must be enough capital to open all 4 linked positions.

A PosSizer that buys a basket of same bar linked positions might work.

pubx101 - 25% sizing in the original strategy of $10,000 portfolio will buy an initial position of $2500. After all possible splits there are 4 positions of $625 each.
profile picture

Eugene

#22
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).