It’s been a very long time

What’s up? Its been a very long time since I’ve posted something in my blog. I’m been very busy with my current job at a startup and it has gotten a good kick start. I’m also busy with trading equities in the PSE and also trading currencies in Forex. I learn a lot during those times.

Web Development

I’ve been developing backend services for our startup company writing REST based backend application using NodeJs (NestJS framework). It involves a lot of async stuff but one of the biggest learning so far is the usage of Event Store and also the usage of Pubsub pattern.

With Event Store, we can store events that changes the state of an object (we call it aggregate in DDD). We can track the changes of that object by reading the events specific to that object. We can also rollback in time to see the previous state of that object.

With Pubsub pattern, it is basically just messaging where we publish a message and a subscriber will listen to it and act on it. This is useful for asynchronous jobs and is great when paired with event-based architecture.

Another big learning is the pattern called Command Query Responsibility Segregation (CQRS). In means that you have a separate model to create/update information and another model to read information. This gives us the opportunity to improve performance and to further improve the structure of the application. You know where to look if you want to write information and where to look if you want to read information.

All of these patterns/technologies add a complexity to our project but at the same time a big investment moving forward in the future. If we do this right, then we will be for sure rewarded in the future. So far, we are going in the right direction. We are learning as we go along.

And one more thing, I’m more involved in our Kubernetes stack which is very cool and we use Google Cloud as the platform/provider. I don’t really design the infrastructure but I have the chance to use it to make my life as a developer easier.

Trading

I’m still actively trading equities in the Philippine Stocks Exchange and currencies in Forex. Actually, I’m currently staying out of the market due to the current situation and my strategy is not working in this environment.

Between August 2019 until early March 2020, I’m very active in trading. I have developed a new strategy where I combined my knowledge in price action from the person I consider my mentor (Money Growers PH) and the trading framework developed by Spyfrat (a veteran trader in PSE). Spyfrat’s framework is not for newbies though, therefore, I would advise to study the basics first before integrating his framework.

Anyway, I developed my own strategy by combining the strategies and system taught to us by my mentor and all the other lessons I learn from people like Kapitan Kidlat, T3, ZFT, Spyfrat, Javi Medina and Trader Dante. I still continue to tweak my system and I see it improve and I see it getting better over time. I still need to trade a lot to see if I become profitable.

Currently, I’m still down in PSE and performance is flat from its bottom (currently down 39%). In Forex, I’m just down 2.5%. This is because I’m more prepared in Forex and more disciplined compared to when I started with PSE.

Priorities, priorities

It turns out, I still love my web development career and I don’t think I’ll stop. I’ll put more time and effort on my job but will continue to push thru my trading career, lowly, as long as I don’t stop.

COVID19

We are currently in a soft lockdown in our town. We mostly just stay at home. We are lucky to have enough supply for the month but we will need to buy more by end of month. It is still uncertain as to when this pandemic would end so we need to stay at home. I just hope our startup company will survive in all of this.

Posted in Personal Blog, Trading, Web Development | Leave a comment

Jest tests failing on CircleCI – ENOMEM: not enough memory

Out NestJS tests are intermittently failing with “not enough memory” error being thrown. There is nothing really special about the tests except for the fact that it is growing as the project grows. It turns out a simple CLI parameter … Continue reading

Posted in NodeJS | Tagged | Leave a comment

TIL – Jest expect to throw error in an async call

I just wanted to test that a certain async call should throw an error and I tried it on Jest. I’m already familiar with RSpec which has similar syntax. Below is what I did. The exec method is an async … Continue reading

Posted in JavaScript | Tagged | 1 Comment

MongoDB ReplicaSet on Docker Environment

I was playing around with MongoDB ReplicaSet yesterday in a Docker environment. The purpose is to test the integration with a backend service that connects to MongoDB. It was a very frustrating process especially when done in a local environment … Continue reading

Posted in Docker, MongoDB | Tagged , | 4 Comments

Docker Compose Environment Variable and Quotes

TLDR: Do not put any double quotes or single quotes into the environment parameter in the docker-compose.yml file. Do we really need the long version of the story? Instead of this: Use this instead: Now this is odd as I … Continue reading

Posted in Docker | Tagged , , | Leave a comment

React Native + Expo + Redux – _react.default.memo is not a function

As of early June 2019 using the latest version of Expo, I’m not able to use Redux as I’m getting this error memo is not a function when trying to use connect. Spoiler, it is because Expo is using a … Continue reading

Posted in React Native | Tagged , | Leave a comment

Using Base64 encode/decode in a React Native/Expo app

I can’t believe that I can’t easily encode and decode Base64 string in React Native without pulling my hair. I’m using Expo to manage my development workflow and it even adds more confusion. Thankfully, a little trick saves me from … Continue reading

Posted in React Native | Tagged , | 2 Comments

First Metro Securities Change Password Issue

When I tried to login to First Metro Securities today, it says that my password already expired and won’t let me log in. I think I went to the classic version and tried to login too but when I changed … Continue reading

Posted in Investments | Tagged | Leave a comment

React/Expo Uses the Incorrect IP Address in Windows 10

My setup is in a Windows 10 machine with VirtualBox installed with a Host Only Network added by VirtualBox. Every time I run expo start it always picks up the VirtualBox network adapter instead of my machine’s Ethernet adapter. Without … Continue reading

Posted in React | Tagged , | Leave a comment

TypeScript – URLSearchParams iterator typing issue

In a certain React course in Udemy, I encountered an issue on React and Typescript where an iterator does not work the way it is shown in the course and this is probably because the course is not written in … Continue reading

Posted in React, TypeScript | Leave a comment