Update under progress...
Wait until i remove this message
FlatTrade Account
If you want to open account with Flattrade kinndly use this link https://openaccount.flattrade.in/O_FT038256
Donate
If you like my codes, consider for a donation. UPI details given in right side tab and in my telegram channel
Instructions
Live Updates/instructions will be given in the telegram channel EasySimpleTradeUpdates
FlatTrade API
Get API from from Flattrade . Watch this video . Only for API . For Login and Orders new AFL available.
Database
Create new database with base time interval 1 minute. Make it default database (it enable while creating database). I keep PC Date format as DD-MM-YYYY. if anything goes wrong check this.
RAM Disk.
Install RAM Disk from here . Watch this video for installation instructions . Keep Drive letter as R. File system FAT32. Size 64MB.
Python installation, creating folders, downloading AFLs, python script , csv files, format files all can do by batch script. check my telegram channel.
Python (batch script available)
Install official python 3.13.2 or 3.13.3 version from here . Watch this video for installation instructions . Jupyter notebook not required. Update PIP.
Default Folders (batch script available)
We use three folders. Create a Folder in C Drive as 'API' and 'HistoricalData'. Then keep drive letter as 'R'. In codes , these are default path to be used. if you want different paths change them in codes. Put all .csv files .py scripts in API folder. Ram Disk R is for to save response file. HistoricalData folder is for long period data download.
Downloads (batch script available)
All codes download here. Download Flattrade Login 1.py and Flattrade Limits 1.py and Put these two scripts in API folder (C:\API) . Download Flattrade Dasboard.afl and put in custom folder. Download format file OneMinuteFeed.format . Put the files in Format folder in Amibroker installation folder. For 32bit it is C:\Program Files (x86)\AmiBroker\Formats. OneMinuteFeed is for live feed. Download FlatTrade OneMinuteFeed.py and FlatTrade Backfill.py and put in C:\API folder
Amibroker cconfiguration
Usernum
Usernum given as in parameter. it is for multiple users. for single user , use the default. Also the same number used in variables and scripts.
Login
from C:\API folder, open Flattrade Login 1.py file in IDE or in notepad.
Change your credentials with in the quotes. Change User ID, Password, TOTP Key, API Ket and API Secret . In the login_file drive letter R is the RAM disk drive letter. check this you are also using the same. It can run by from IDLE run module or double click to Execute. In Limits file no need to change anything. Limits file can run from Amibroker only.
Apply Flattrade Dasboard.afl on chart. You can apply on background sheet also like Sheet 2, Sheet 8 etc.
Check Parameter C:\API\ Driver letter and Folder Name are same as yours. Click Login. It execute login script and if login success execute limits script and Show the User ID and Cash Balance. StartFeed is to start feed. to stop feed just close the CMD window. Backfill files are download to RAM disk , so if you increase , decrease Number of downloads. 0 is for current day. it is for live market back fill, that time you can increase Number of Parallel Downloads to 20. For longer duration with from to date, use ScripMaster.afl . If you already use Order Place, You ca use this login also. Also check order place properly before market open.
OneMinuteFeed (*.*)|*.*|OneMinuteFeed.format
and save it. it is for manual importing data files from Amibroker Import ASCII.
For Backfill and Live we need to create a token list as ScripMaster.csv . You can use ScripMaster afl. We give input as *List.csv for multiple symbols. by clicking respective button in ScripMaster afl, it create *Master.csv file with token. Then click Join files , it merge all files *Master.csv in API folder and create ScripMaster.csv
Now you can backfill , Historical Data and Live Feed. Backfill is for recent days, for this we can give as number of days. To backfill current day give 0. Historical Data can download data by giving date range. it have option to import and delete in parameter.
This is initial version only. More Features and other brokers will come.