Giter Club home page Giter Club logo

tradingview-trainer's Introduction

demopic

Tradingview-trainer

tv-trainer is a lightweight application written in python using selenium and Tkinter, designed to work with tradingview.com to help users practice their trading on historical data.

Installation

tv-trainer comes in two forms, the executable version and the python version.

Python Version

Executable Version

How to Use

Getting Started

To launch the executable version, double click the app.exe after extracting the .zip. To launch the python version, run in a command line, in the app.py directory; python app.py. After the app luanches, a browswer window to tradingview.com's sign-in page will open. As of May 2019, you will need to have an account to access the replay function (accounts are free to create!). Sign in with your credentials and then navigate to your chart.

Once you have configured your chart to your liking, you are ready to start! Click the bar replay button in the top nav bar of the chart. Move the vertical red line to the time you wish to start practicing on the historical data and click. Next, move to the tv-trainer window. Click the ▮▶ next bar button. This will advance the chart 1 bar and get the information to the tv-trainer app. Keep in mind, the values you see in the tv-trainer app represent the close of the previous bar, values are only updated during user actions. You are now ready to place your orders!

Orders

There are two types of orders available with tv-trainer. The two most basic orders intrinsic to most exchanges. The limit order and the market order.

Market Order

To submit a simulated market order, ensure market is selected via radio-button near the top of the app. When you reach a point where you feel you wish to buy, click Buy. When you reach a point where you wish to sell, click Sell. Your order will instantly be executed, using simulated FIFO.

Limit Order

To submit a simulated limit order, ensure limit is selected via radio-button near the top of the app. Next, type in the limit price entry box the price of your limit order. You can also click last to auto-fill the last close, making it easier to quickly change the price. Once the price crosses or touches your limit order, the order will be executed at the limit price, using simulated FIFO.

FIFO

A more detailed explaination can be found here. FIFO stands for "First In First Out". This means orders are filled in the order they are submitted. For this app, since there are only the user orders, the best part of FIFO (in my humble opinion) has been simulated. Simply put, when you are long you are 100 APPL @ $100 for example. When you are short, you are -100 APPL @ $100. To close a short/long simply make your position = 0. Again, a more detailed explaination can be found here.

Exiting

Upon exiting, a file named trades.csv is created. This contains your trades, it can be easily viewed with excel or similar. When you exit, ensure both the chromedriver browser and tv-trainer window are closed. If you run into any issues please report them! https://github.com/Robswc/tradingview-trainer/issues

Common Errors and how to fix them

You can check out the wiki page: https://github.com/Robswc/tradingview-trainer/wiki/Errors

This will list and show you how to fix the more common errors.

About

That's about it! Thank you for trying my app if this helps you in anyway feel free to follow me on twitter for more tools and updates!

tradingview-trainer's People

Contributors

betegon avatar robswc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tradingview-trainer's Issues

limit orders

Currently limit orders (have pushed me to my limits ;)) are not implemented. The logic is there in the order engine, just need to connect it to the GUI. My focus has been just getting everything working to the point where it can be used easily, including writing some of the wiki and doing tutorials, etc... I'll be updating it to support limit orders very, very soon!

Chrome Driver, version must be between 'x' and 'y'

This error occurs when either the chromedriver.exe is outdated or the users chrome is outdated.
This can be fixed by ensuring both the chromedriver.exe and chrome application are on the same version.

You can check your chrome version by typing:
chrome://version

in the address bar, keep in mind the first two digits (i.e. 73, 74, etc...)

Now visit:
http://chromedriver.chromium.org/downloads

Find the corresponding chromedriver and download it. Replace your existing chromedriver.exe with the new chromedriver.exe.

Replay Error

Sometimes there will be a disconnect between the web-page and the app. This can be caused by a number of things, however the main cause is a slight difference in the way the chart loads on some machines vs others OR tradingview.com updating their site.

Whatever the case may be, it can likely be solved by using custom xpaths. You can find how to do so here.

https://github.com/Robswc/tradingview-trainer/wiki/xpath-errors

failed to execute script app

"failed to execute script app" is the message I'm getting when I try to run app.exe. Executable version.
I use:
Windows 10 Home, version 1903,
Chrome: Version 80.0.3987.163 (Officiel version) (64-bit)
Also updated chrome to newest just now (81.0.xxx...), and it's the same issue.

I also tried running as administrator, no change.

Xpath

I don’t know how to paste the xpath to the app

Is it broken?

Hello,

Congratulations on the idea, it is just awesome! I tried to run but it doesn't seem to get the prices nor to work at all. Is it deprecated?

Thanks.

'charmap' codec can't encode character '

Shows this error upon closing the chrome browser. GUI didn't even open.

Order Engine Tick

{'bid': {'qty': 0, 'price': 0}, 'ask': {'qty': 0, 'price': 0}}

GET LAST ORDER ENGINE HIGH: 0
GET LAST ORDER ENGINE LOW: 0
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u25b6' in position 0: character maps to

No last price

Hi. Im not sure if your still updating this project, but I thought I ask anyway. I have an issue in that app is not able to get the price. cant trade. do you know any fix for this. Thank you.
These are the error:



PY_VAR8
Order Engine Tick

{'bid': {'qty': 0, 'price': 0}, 'ask': {'qty': 0, 'price': 0}}

GET LAST ORDER ENGINE HIGH: 0
GET LAST ORDER ENGINE LOW: 0
▮▮
▮▮
Order Engine Tick

{'bid': {'qty': 0, 'price': 0}, 'ask': {'qty': 0, 'price': 0}}

GET LAST ORDER ENGINE HIGH: 0
GET LAST ORDER ENGINE LOW: 0
▮▮
▮▮
▮▮
PY_VAR8
Order Engine Tick

{'bid': {'qty': 0, 'price': 0}, 'ask': {'qty': 0, 'price': 0}}

GET LAST ORDER ENGINE HIGH: 0
GET LAST ORDER ENGINE LOW: 0

LIMIT BIMIT ORDER HEHEH
Adding limit order to orderbook: 10000 -20.0
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python38\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "app.py", line 404, in order_buy
oe.limit(OrderEngine, round(get_account_value(), 2), float(self.limit_price.get()), self.get_last_price())
File "D:\TV Trainer\app\order_engine.py", line 183, in limit
if quantity > 0 and limit_price < last_price:
TypeError: '<' not supported between instances of 'float' and 'NoneType'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.