Just another helping hand
7th October, 2017. A fine Sunday morning with a coffee mug in one hand and my phone in the other. A text from a friend pops up on the screen which says : “Use this app. Send ₹51 to me and I’ll return it back. Both will get some money in return”. And that’s how I got introduced to Google Pay (called Tez in those days). Life changed after that and I’m definitely not the only one. Almost everyone started enjoying the process.
Referrals, Scratch Cards, Cash Backs and the list goes on. Even today, if I scratch a card and get something around ₹10, I consider it to be a very lucky day. But that’s not the same for all the days. It’s kind of a once in a blue moon. What if we could have it every day? And why just 10, why not 20, or 50, or may be 100 and more. One of such ways is TRADING. Intraday trading to be specific. We’ll get into the details later, let’s have a look at the chart first.
Any typical price action chart can look similar to this. Usually these are filled with trends and fluctuations. Let’s assume a company XYZ, on 30/12/20, had it’s price action as mentioned in the picture above. It’s obvious from the chart, that if we had bought just a single share at 10.40 AM(Point A) and sold it back at 11.30 AM(Point B), we could have made a profit of ₹20 within an hour.
Looks so simple and easy, right? But is it really so easy..??
It was a chart made by plotting the historical data. That’s the reason we could decide the entry and exit points so easily. But it’s a totally different scenario, when we track a real time price action.
Let’s go back in time and assume it’s 10.40 in the morning of 30th December. Since we don’t have any idea about the upcoming price action, it really gets difficult to decide what needs to be done.
Okay, by any means, we decided to go Long (In simple terms, buy).
After entering at 10.40, we got an uptrend and we stayed for a while. At 11.00, there’s a sharp depression (“Pullback” in trading terms)and it looks like a good point to Exit. But from the historical data it’s evident, that the price would go still higher. Should we stay or exit right away??
And finally we stayed till it was 11.30, again there’s a depression. But this time, it’s a genuine one. And considering the historical data, we should exit at this point. So what’s the difference between this one and the one we got at 11.00?
Considering all these scenarios, it’s obvious that taking decisions during a real time price action is very difficult. As quoted by Investopedia :
The biggest lure of day trading is the potential for spectacular profits. But this may only be possible for the rare individual who possesses all the necessary traits required to become a successful day trader, such as decisiveness, discipline, and diligence.
In simple terms, it’s actually a very profitable process. But it requires a lot of homework and experience to handle the Game of Trends.
How disheartening..!!
And here enters this animated pretty lady. Not just an animation, but she’s more than that. An ai based price action tracking application. She’s capable of tracking the trends and fluctuations of any desired company on any active market day and tell us when to enter/exit by sending notifications to our smart phones. Just a glimpse of what she can do :
Beauty with Brains right!! But how’s she doing that..?
Before we dive into the mechanism and decision taking process of the application, let’s cover a bit of finance first.
So, what exactly the term ‘share’ means? As the name suggests, it’s something related to sharing. Now what are we sharing..? The answer is ‘Ownership of company’. That means, more the number of shares I have, more will be my ownership. Let’s take an example : “Ambanis are the owners of Reliance Industries Ltd.” This is a statement which is known to all. But how can we prove this statistically??.
As mentioned in Wikipedia :
The promoter group, the Ambani family, holds approx. 46.32% of the total shares whereas the remaining 53.68% shares are held by public shareholders
Since, a single family owns the most number of shares, we can claim that they are the owners.
Now let’s consider the price action. Why does the price of a share keeps on changing every day? Not just every day, it happens every second. Why can’t it simply stay the way it is? When put in the simplest manner, stock market is like an auction. An auction with a group of sellers and buyers where they keep on bidding. When the buyers outnumber the sellers, the sellers tend to sell their shares at higher prices, hence the overall share price goes up and vice versa. And these numbers change every moment.
The number of buyers/sellers, depend on a myriad of factors. Some significant factors can be economic reports, world and national events, balance sheets, current affairs etc. Collectively, all these factors influence the Market Sentiment, which can be Bearish or Bullish or Sideways.
But there’s no simple and straight forward way to understand the Market Sentiment in real time. Hence, we need to prefer a more statistical approach, called Technical Analysis. It’s a method of forecasting the direction of prices through the study of past market data which can be represented in the form of Technical Indicators. The history goes back to more than 2 centuries when these methods got originated. Currently, there are more than 100s of these indicators which have their own way of analysis. Some of these include: MACD (Moving Average Convergence Divergence), RSI (Relative Strength Index), OBV(On Balance Volume) etc. A typical chart with a couple of indicators may look like this :
Now we have everything to understand the decision taking process.
The system is designed to track these entry/exit points in real time. The instantaneous values of price and volume are ingested into the system through Kite Connect(The stock market API services provided by Zerodha).
Every trader incorporates a general or unique strategy by analyzing the indicators. And just a single indicator is never enough to take decisions. Ideally a set of indicators is used simultaneously.
Tracey executes one of such strategies. Once the values from Kite Connect are fetched, the appropriate set of indicators is calculated parallelly. After the calculation, the data goes through a preprocessing step. An already trained Neural Network model running on Google Cloud’s AI Platform accepts the data and sends the prediction. That’s how the entry points are detected.
- Kite Connect (Data Source)
- Parallel Processing for calculating the indicators
- Preprocessing of indicators before prediction
- Trained Model running on AI Platform
The exit points are detected by using the concept of Trailing Stop Loss(TSL). This is just another value which is a bit lower than actual share price. As the name suggests, it’s a value that keeps trailing the current price keeping a maximum distance given as input. It has a key feature of not moving in the opposite direction. When the price makes a cross over, we need to exit.
Let’s take an example from our previous scenario. If I give a value of 5 as TSL, then it starts from 1975(5 less than 1980). As the price went up, the TSL value went up too. But when the price came down, the TSL remained the same(10.45am to 10.53am). Similarly at 11.00am it remained the same, but there was no cross over, hence the system didn’t give an exit notification. Finally at 11.30am the price went below the TSL value, and the system detected the Exit point.
She uses, Google Cloud’s serverless platform App Engine with a Flexible Environment to run the containers along with API Gateway. The Android version of the application is currently under development which will be available on Google Play Store, very soon. That will be followed by the development for iOS devices.
- AI Platform
- App Engine
- Kite Connect
- MongoDB
- API Gateway
- Android/iOS Devices
(All these caricatures are merely memojis designed on iOS. The final version to be used in devices will be designed from scratch with appropriate tools)
Some limitations :
- The timeframe is only single day (Intraday Trading only)
- To be used only after 10.00am for best results (from my own experience)
- She can track only a single company at a time
- The domain is confined to equities only
All these limitations will be addressed in the near future. The timeframe will be increased along with better and refined analysis techniques to provide assistance in Swing Trading or Long term Investments for multiple companies simultaneously. The domains will be expanded to cover Mutual Funds, Futures, Options, Commodities, Currencies etc.
Indeed it’s a long journey ahead. And it’s just a beginning by just another helping hand..