If you use broker specific trading account directly in your strategy code, then you need to modify your code whenever you want to change stock broker. To overcome this problem, our system uses a concept of dummy or pseudo account.
A pseudo account is just a pointer to the actual trading account. You can assign any meaningful name to the pseudo account. A user maps a pseudo account to a trading account through system settings. When he needs to change a stock broker, all he needs to do is to map this pseudo account to another trading account from new broker.
placeOrder("DUMMY_ACC", "NSE", "BANKNIFTY_28-MAY-2020_CE_25000", "BUY", "LIMIT", "INTRADAY", 20, 230.55, 0);
- ABC123 – (Stock Broker: Zerodha)
- XYZ321 – (Stock Broker: Upstox)
- DUMMY_ACC -> ABC123
As you can see, our pseudo account is currently mapped to the trading account of Zerodha. Our strategy is currently running in a Zerodha trading account.
If we need to change the trading account, we simply map it to Upstox trading account. Our strategy will now work with Upstox trading account. There is no need to make any code changes in your strategy.
Note: One pseudo account maps to only one trading account.