PTV is a useful widget for trading view for doing paper trading when bar reply is enabled

Overview

Alt text

GitHub GitHub contributors GitHub repo size GitHub top language

PTV (paper-trading-view)

paper_trading_view is project written for simulate trade in Demo it use trading view when bar reply is enable.
as you know trading view doesn't have paper trading on bar reply and we prepare it for you in this project, PTV provide you a demo account for upgrade your skill in trading

Why?

this feature does not exist in TradingView . you can use it for train , backtest youre strategies

How It Works

howwork

Quick installation (for windows users)

1- Download project

you can easily download executable version of this project from this Link

2- make sure you installed chrome browser on your device . go to tradingview.com and login into your account .

3- Extract .rar file and Run ptv.exe

Quick installation tutorial video

Notice: Every time you want to run ptv.exe make sure chrome is closed before.

Features

  • Based on Python 3.7+: For botting on any operating system - Windows, macOS and Linux.
  • work with TradingView: For bar reply and getting price we use trading view.
  • Limit/Market orders: you can place a Limit or Market order in 2 side "long", "Short" .
  • SL/TP set: you can set stop loss and take profit for your market or limit order .
  • see Open orders: you can see list of open orders.
  • see Open positions: you can see list of open positions.
  • see trade history: you can see list of trade history.
  • Next/Play/Pause in bar reply: you can use this items in PTV and when price is changing open positions and open orders will be check.
  • initial setting: you can set your initial money / commission.
  • profit/loss of account: your total profit / loss calculate when your position close.
  • save report: you can save your trade history in a csv file.

Requirements

  • Python 3.7+ (install it from website)
  • Chrome driver (Download it from website)
  • selenium ,tkinter

Getting start

make sure you installed python3.7+

# you can clone project from github
git clone https://github.com/xibalbas/paper_trading_view.git
cd paper_trading_view/src

# or
# you can download project zip file and extract 
https://github.com/xibalbas/paper_trading_view/archive/refs/heads/master.zip
cd paper_trading_view-master/src

make an enviorment

pip install virtualenv
python -m venv venv

# Linux Users
source venv/bin/activate

# Windows Users
.\venv\Scripts\activate.bat

install requirements packages

pip install -r requirements.txt

Run

python app.py

Contributing

Contributions are very welcome. There are a number of requirements:

  • See Issues tab, and feel free to submit your own issues
  • Add PRs if you discover a solution to an existing issue
  • The code should be Pep8 compliant.
  • Comments are required for every class and function and they should be a clear description.
  • At least one broad test case and a set of unit tests must be provided for every function.
  • Avoid very pythonic construction

License

PTV is freely available under the MIT license.

Comments
  • demo installation

    demo installation

    hello could you post a demo video on how to install things properly for those of us not familiar with coding and python usage the idea of your application is brilliant ive been searching ages for such pretty sure it is worth some money only thing i struggle with is to run it on python as i constantly get message of wrong sintaxis when copypasting or im doing it totally wrong

    question 
    opened by tehluny 2
  • it is not running in my windows 11 64 bit

    it is not running in my windows 11 64 bit

    Traceback (most recent call last): File "app.py", line 38, in File "selenium\webdriver\chrome\webdriver.py", line 76, in init File "selenium\webdriver\remote\webdriver.py", line 157, in init File "selenium\webdriver\remote\webdriver.py", line 252, in start_session File "selenium\webdriver\remote\webdriver.py", line 321, in execute File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 97 Current browser version is 103.0.5060.114 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "app.py", line 56, in RuntimeError: input(): lost sys.stdin

    opened by ArianKhadem 1
  • Trade instantly closes and loses on opening of trade

    Trade instantly closes and loses on opening of trade

    Sometimes when you open a trade it will instantly close itself as a loss ( or sometimes a profit). In this case it was a limit order. Note that price has not reached SL or even the price in the chart. image

    bug 
    opened by Ramblingjack 1
  • user data directory is already in use

    user data directory is already in use

    Traceback (most recent call last):
      File "[app.py]()", line 38, in <module>
      File "selenium\webdriver\chrome\[webdriver.py]()", line 76, in _init_
      File "selenium\webdriver\remote\[webdriver.py]()", line 157, in _init_
      File "selenium\webdriver\remote\[webdriver.py]()", line 252, in start_session
      File "selenium\webdriver\remote\[webdriver.py]()", line 321, in execute
      File "selenium\webdriver\remote\[errorhandler.py]()", line 242, in check_response
    selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
    
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "[app.py]()", line 56, in <module>
    RuntimeError: input(): lost sys.stdin
    
    bug enhancement 
    opened by xibalbas 4
  • BTCUSD bug

    BTCUSD bug

    Hey xibalbas, i will be making many issues, not because i dislike this program but because i love it so i hope you don't mind.

    There is an issue where the program will use BTCUSD instead of the chart that is default (EURUSD for me)

    question 
    opened by Ramblingjack 3
Releases(v1.0.1)
Owner
Ali Moradi
working on Algo trading , cryptocurrency , Django
Ali Moradi
Wechat based auto reply with pyautogui

Python-微信 自动回复 练手~ 一直想做个给微信发个消息,就可以跑Python程序,并将结果发送给我的东西,之前看了 B站@不高兴就喝水 的视频,终于有了灵感~ 使用的是模拟点击方案,请求期间是不能操作了。 库 pyautogui 用于模拟鼠标键盘操作和定位操作位置 pyperclip 剪贴板

Vito Song 1 Oct 22, 2022
Discord Bot that can translate your text, count and reply to your messages with a personalised text

Discord Bot that can translate your text, count and reply to your messages with a personalised text

Grizz 2 Jan 26, 2022
This bot will pull a stream of tweets based on rules you set and automatically reply to them.

Twitter reply bot This bot will pull a stream of tweets based on rules you set and automatically reply to them. I built this bot in order to help comb

Brains 1 Feb 13, 2022
Cryptocurrency Trading Bot - A trading bot to automate cryptocurrency trading strategies using Python, equipped with a basic GUI

Cryptocurrency Trading Bot - A trading bot to automate cryptocurrency trading strategies using Python, equipped with a basic GUI. Used REST and WebSocket API to connect to two of the most popular crypto exchanges in the world.

Francis 8 Sep 15, 2022
It is a useful project for developers that includes useful tools for Instagram

InstagramIG It is a useful project for developers that includes useful tools for Instagram Installation : pip install InstagramIG Logan Usage from In

Sidra ELEzz 14 Mar 14, 2022
A small bot to interact with the reddit API. Get top viewers and update the sidebar widget.

LiveStream_Reddit_Bot Get top twitch and facebook stream viewers for a game and update the sidebar widget and old reddit sidebar to show your communit

Tristan Wise 1 Nov 21, 2021
A collection of scripts to steal BTC from Lightning Network enabled custodial services. Only for educational purpose! Share your findings only when design flaws are fixed.

Lightning Network Fee Siphoning Attack LN-fee-siphoning is a collection of scripts to subtract BTC from Lightning Network enabled custodial services b

Reckless_Satoshi 14 Oct 15, 2022
A collection of scripts to steal BTC from Lightning Network enabled custodial services. Only for educational purpose! Share your findings only when design flaws are fixed.

Lightning Network Fee Siphoning Attack LN-fee-siphoning is a collection of scripts to subtract BTC from Lightning Network enabled custodial services b

Reckless_Satoshi 14 Oct 15, 2022
Utilizing the freqtrade high-frequency cryptocurrency trading framework to build and optimize trading strategies. The bot runs nonstop on a Rasberry Pi.

Freqtrade Strategy Repository Please test all scripts and dry run them before using them in live mode Contact me on discord if you have any questions!

Michael Fourie 90 Jan 1, 2023
This program is an automated trading bot that uses TDAmeritrades Thinkorswim trading platform's scanners and alerts system.

Python Trading Bot w/ Thinkorswim Description This program is an automated trading bot that uses TDAmeritrades Thinkorswim trading platform's scanners

Trey Thomas 201 Jan 3, 2023
Intelligent Trading Bot: Automatically generating signals and trading based on machine learning and feature engineering

Intelligent Trading Bot: Automatically generating signals and trading based on machine learning and feature engineering

Alexandr Savinov 326 Jan 3, 2023
Trading bot - A Trading bot With Python

Trading_bot Trading bot intended for 1) Tracking current prices of tokens 2) Set

Tymur Kotkov 29 Dec 1, 2022
Crypto-trading-simulator - Cryptocurrency trading simulator using Python, Streamlit

Crypto Trading Simulator Run streamlit run main.py Dependency Python 3 streamli

Brad 12 Jul 2, 2022
Useful tools for building interactions in Python

discord-interactions-python Types and helper functions for Discord Interactions webhooks. Installation Available via pypi: pip install discord-interac

Discord 77 Dec 7, 2022
IMDbPY is a Python package useful to retrieve and manage the data of the IMDb movie database about movies, people, characters and companies

IMDbPY is a Python package for retrieving and managing the data of the IMDb movie database about movies, people and companies. Revamp notice Starting

Davide Alberani 1.1k Jan 2, 2023
Simple script to extract useful informations from the combo BloodHound + Neo4j

bloodhound-quickwin Simple script to extract useful informations from the combo BloodHound + Neo4j. Can help to choose a target. Prerequisites python3

null 140 Dec 21, 2022
Automation for grabbing keys from a Linux host. Useful during red team exercises to quickly help assess what access to a Linux host can lead to.

keygrabber Automation for grabbing keys from a Linux host. This can be helpful during red team exercises when you gain access to a Linux host and want

Cedric Owens 14 Sep 27, 2022
A simple but useful Discord Selfbot with essential features, made with discord.py-self.

Discord Selfbot Xyno Discord Selfbot Xyno is a simple but useful selfbot for Discord. It has currently limited useful features but it will be updated

Amit Pathak 7 Apr 24, 2022