Systematic Intraday Index Trading Experiment

ncube

Well-Known Member
#11
25/1/2021: Afternoon Session:

Broke my 3 trade rule and took couple of extra trades. Overall a satisfactory day in both intraday options strategy (happy coincidence as the closing point of 3rd trade turned out to be near the system generated signal..:)) ) and equity positional. Booked good profit in equity positions and was able to bring down direct equity exposure to less than 50% , plan to go into the budget week lighter.

Signals:
1611569375305.png


Trades:
1611569569903.png
 
Last edited:

ncube

Well-Known Member
#12
Some tweaking might be necessary on the instrument selected, but as long as the system is working as intended is no problem using it :)
The system is behaving as expected, it was a mistake from my side as I input the wrong options into the system. The system placed the SL order well in advance corresponding to the nifty price, however the option price did not reach the SL and the trade failed and I made the mistake of manually placing the trade at the next system signal even though its confidence value was low. This happened as I did not have a plan on what to do next if the trade execution failed... good example to shows why day trading is stressful and how it impacts our emotions...we tend to make mistakes when we are unsure and all the probable system rules are not well defined...:)

Anyway over the weekend I have made a small tweak in the system by giving more weightage to the trend...and SAR trades will be initiated only when there is change in trend, this I believe will reduce the no of points but will help generalize the strategy to work efficiently in both trending & non trending periods and reduce losing trades. Also I am exploring to use this strategy signals at higher time frames to identify the short term equity price moments and also to time the portfolio hedging points, this would be my final objective.
 
Last edited:

ncube

Well-Known Member
#14
28/1/2021:

Updated the system to act as an hedge to my equity positions, will be more lenient to take some losses in puts.

Trade Signals:
1. Sell: 13860; Buy: 13880; Points: -20
2. Sell: 13865; Buy: 13822; Points: +43

1611816670561.png


Trades Taken:
1611816752652.png


Here I will stop this experiment as I have collected sufficient data to be confident with the system behavior and next I will explore to use it as a hedging strategy for my core portfolios as having a timed hedge will smoothen the return curve nicely.

Update: Just checked that the automated system had already placed the 3rd trade...sometimes automation helps to get lucky...:)

1611818899541.png

1611818954035.png
 
Last edited:

ncube

Well-Known Member
#15
Jan 2021 will be a memorable one for me in my trading career, I crossed a new major milestone helped by this bull run. I had once decided long back that I will share some of my thoughts here whenever I cross a milestone and So far I have shared information in almost all form of trading aspects that I have practiced and experienced, you can find it in the threads mentioned below.

Some of the posts are not explicit, but you will be able to interpret it when the time is right and you start facing similar situations. For example in this thread I showed equity trade logs (All sells) along with options which is a distraction, But I just wanted to convey I am reducing my positions and how one should reduce size/book profits...you will find similar posts in these threads. Enjoy reading these. Will need lot of patience...after all trading is actually a business of trading patience...:)

1. Long term investment: https://www.traderji.com/community/...stment-strategy-to-beat-nifty-returns.108390/
2. Pairs Trading: https://www.traderji.com/community/...tatistical-arbitrage-trading-concepts.106739/
3. Swing Trading: https://www.traderji.com/community/...ading-with-only-price-action-analysis.110006/
4. Income Generation: https://www.traderji.com/community/...c-low-risk-income-generating-strategy.110150/
5. Systematic Investing Process: https://www.traderji.com/community/...stment-portfolio-performance-tracking.108903/
6. Intraday Trading process: https://www.traderji.com/community/threads/systematic-intraday-index-trading-experiment.110135/
7. Trading Psychology: (Contributed in Madan's thread): https://www.traderji.com/community/...reer-musings-of-a-professional-trader.105524/

With this I will take your leave, will return with something new when I cross the next major milestone... hope Year 2021 has started well for all and lets see how the year unfolds. Until then Trade smart and make lots of money, always trade with a long term view.. bet just enough to make a difference and survive long enough to repeat it indefinitely!!!
 
Last edited:

Raj232

Well-Known Member
#16
28/1/2021:

Updated the system to act as an hedge to my equity positions, will be more lenient to take some losses in puts.

Trade Signals:
1. Sell: 13860; Buy: 13880; Points: -20
2. Sell: 13865; Buy: 13822; Points: +43

View attachment 45378

Trades Taken:
View attachment 45379

Here I will stop this experiment as I have collected sufficient data to be confident with the system behavior and next I will explore to use it as a hedging strategy for my core portfolios as having a timed hedge will smoothen the return curve nicely.

Update: Just checked that the automated system had already placed the 3rd trade...sometimes automation helps to get lucky...:)

View attachment 45380
Sirji .. this is not fair.. your experiment is an inspiration to all .. you must continue to post for a month at least !!
Moreover dont forget 1 free copy for me.. :):)
 

ncube

Well-Known Member
#17
Sirji .. this is not fair.. your experiment is an inspiration to all .. you must continue to post for a month at least !!
Moreover dont forget 1 free copy for me.. :):)
Sirji...I did not realize my experiment is such an inspiration to others as there were no questions asked or clarifications sought by anyone...:)

It was becoming monotonous and I have already shared the secret recipe in the posts, someone with experience can easily make out the strategy by studying the charts and the details I have explained..:).

I just wanted to walk forward test the strategy for few days before taking it into production as I have already tested it for more than a month and the system has already completed couple of million interations on Nifty index on multiple timeframes. Also experimenting for long time with single lots does not justify the effort and time spent...right?..:)

Anyway till the budget week I don't plan to take any new trades, however later let me see if time permits I will try to post the system market direction if it will help others but usually my posts gets delayed becoming visible to everyone.

You don't need a free copy you are already an expert....understanding the concept is more important than the exact trading rules...I am sure you can easily design the rules as per your psychology!!! But we can always meet in person and compare our strategy rules...:)
 
Last edited:

Raj232

Well-Known Member
#18
You don't need a free copy you are already an expert....understanding the concept is more important than the exact trading rules...I am sure you can easily design the rules as per your psychology!!! But we can always meet in person and compare our strategy rules...:)
Sure. Thanks. I'm more interested in the method used to automate it. Which version is Amibroker is suitable. which economical data provider to be used or is there a free extractor from broker ticks ?
I'll experiment on 1 lot and post the results. :)
 

ncube

Well-Known Member
#19
Sure. Thanks. I'm more interested in the method used to automate it. Which version is Amibroker is suitable. which economical data provider to be used or is there a free extractor from broker ticks ?
I'll experiment on 1 lot and post the results. :)
Sorry, I am not familiar with Amibroker, I have developed my own python backtesting engine as it gives me the flexibility to make customized frameworks and add new features as per my needs.

Zerodha provides a very nice python kite connect api package which can be easily used with any python backtester and it streams live data and we can place trades in real time. Also they provide historical data for backtesting.

Try Using a python open sourced packages as it will make our life easy, for this system I have used the python reinforcement learning framework, RL is a supervised machine learning algorithm which can be trained and later it will learn by itself. This algorithm is usually used in training computers to play chess, crawl web, sentiment analysis etc

You can check this article for an overview:
https://neptune.ai/blog/best-reinforcement-learning-tutorials-examples-projects-and-courses
Example trading scenario:
https://towardsdatascience.com/deep-reinforcement-learning-for-automated-stock-trading-f1dad0126a02

I will just give a hint on how I have built this system, first just look at charts and analyze how you would need to trade it manually:

Preprocessing steps:
1. Select the time frame to trade say 5 min.
2. Identify all the candle pivots (3 candles, with lower highs or higher lows on either side)
3. Mark the structure for all the identified pivots.
4. If needed you can also use some technical signals.

Analysis rules and training the RL model:
1. After completion of each candle, mark its location in the overall structure and take trades (both Buy & Sell)
2. Close the trades at the end of next candle.
3. Define the rewards i.e positive value if its a winner and negative value if its a loss.
4. Now let the RL model iterate over the entire data and learn by itself which are the optimal candles to buy and sell so that its reward points are maximized
5. Manually this is not possible but with computer after a million odd iterations the model will get trained to identify the best candles which will give us higher points.

That's all...enjoy...:)
 
Last edited:

Similar threads