/TeZ

Primary LanguagePythonMIT LicenseMIT

TeZ

:A quick trading app especially for scalpers, running on top of Finvasia APIs:

This project provides all necessary scripts to run the app. As the code is modularized, the modules can be re-used in other projects as well.

Table of Contents

Introduction

For a scalper, quick entry and exit is a most useful feature in a trading app. Scalpers generally tend to trade in 1 or 2 instruments. So, if the app can be pre-configured for trades in those instruments, that will also be helpful.

Before learning scalping options, it would help to learn in a non-derivative instruments such as NIFTYBEES. This app provides such a mechanism. It provides very simple gui and most of the settings are configured before starting the app. Further, the app provides trading NIFTYBEES while the underlying instrument is still NIFTY index.

The app is expected to be very helpful for traders that are trying to learn scalping.

In future versions, buying CE/PE options are also planned.

Features

Following are the features

  • Very simple and intuitive gui
  • Uses Bracket order facility of finvasia for trading NIFTYBEES.
  • Uses Websocket feed for real time updates.
  • Feed can be obtained from one Finvasia a/c and trading can be done in another a/c. This will be helpful, if you have already running algos using websocket.
  • Also has feature to get the session ID from a google sheet. This helps in using the session that is running on a cloud machine.
  • System square off happens at pre-defined Time (SQ_OFF_TIMING in the configuration file).
  • Default order type is Bracket order. OCO order type can be chosen by setting configuration.
  • Supports app lock/unlock mechanism to avoid accidental clicks.

Getting Started

Pre-requisites

The app has been tested under Python version 3.10.5. Any recent versions also should be able to execute the app.

Configuration file details

First step after having the repo is to update the Finvasia credentials in the file 'user_cred.yml' which is available in the folder \data\cred.

Next step is creating the virtual environment for Apps use. For ease of use, a powershell script is given in the ps_scripts folder. To run this, you can refer: Installation

Configuration File Explanation

Refer to sys_cfg.yml This has all configurations required for using the app.

# Configuration File details
GUI_CONFIG:  
  APP_TITLE: 'TeZ - NIFTY'
  APP_GEOMETRY: '250x125'    # Default Size of the app. can be updated by changing here.
  LONG_BUTTON: ' Buy '
  SHORT_BUTTON: 'Short'
  EXIT_BUTTON: 'Exit App'
  SQUARE_OFF_BUTTON: 'Square Off'

TIU:
  TOKEN_FILE: null     #if the session id is to be shared with other algos, the session id file is given here.
  CRED_FILE:  './data/cred/user_cred.yml' 
  ...
  PROFIT_PER: 0.4      # Profit Percentage  - Used for calculating profit points 
  STOPLOSS_PER: 0.2    # Stop loss percentage - Used for calculating stoploss points 
  ...
  QUANTITY: 1
  ...
  TRADES_RECORD_FILE: './log/orders.csv'
  SAVE_TOKEN_FILE_CFG: 'YES'   #if the session id file has to be generated, make this as 'YES'
  SAVE_TOKEN_FILE_NAME: './log/user_token.json'  #session-id along with other information is stored in this file.


DIU:
  ...
  TOKEN_FILE: './log/user_token.json'   #if DIU and TIU are sharing session, use file generated by TIU above
  CRED_FILE: './data/cred/user_cred.yml' 
  ...

SYSTEM:
  LOG_FILE: './log/app.log'  # log file is generated here.
  DL_FOLDER: './log'         # intermediate files such as symbol files are downloaded here.
  ...

Contributing

Thank you for considering contributing to this project! We welcome bug reports to help improve the quality of the software.

Refer

Reporting Bugs

Thank you for helping us improve the project by reporting bugs!

To report a bug, please follow these steps:

  1. Check the existing issues to see if the bug has already been reported. If it has, you can provide additional information or subscribe to the existing issue.

  2. If the bug has not been reported, open a new issue. Use the "Bug Report" issue template if one is available.

  3. Provide a clear and descriptive title for the issue.

  4. Describe the bug in detail. Include information about your environment, steps to reproduce the bug, and any relevant error messages.

Code Style

We appreciate your focus on bug reporting. However, if you notice any code-related issues, please include them in the bug report.

Issues and Discussions

If you have questions or need assistance, feel free to open an issue for discussion.

License

By contributing, you agree that your contributions will be licensed under the project's MIT License.

Installation

Step-by-step guide on how to install.

# To clone the repo.
git clone https://github.com/tarakbluru/TeZ.git
# To create virtual environment and install required packages under windows powershell
cd TeZ
powershell -executionpolicy bypass .\ps_scripts\tez_setup.ps1
# To run the TeZ app while in TeZ folder
powershell -executionpolicy bypass .\ps_scripts\tez.ps1

App Image for NIFTYBEES

Refer

App Image for NIFTY Option (observe bold font)

Refer

Console Image

Refer