Tag Archives: Python

Python becoming the world’s most popular coding language

It seems even the influential Economist magazine claims that Python is the most popular programming language. Here is the headline:

Python is becoming the world’s most popular coding language

Here are some highlights:

In the past 12 months Americans have searched for Python on Google more often than for Kim Kardashian, a reality-TV star. The number of queries has trebled since 2010, while those for other major programming languages have been flat or declining. 

are its simplicity and flexibility…

This versatility means that the Central Intelligence Agency has used it for hacking, Google for crawling webpages,….

Some of the most popular packages harness “machine learning”, by crunching large quantities of data to pick out patterns that would otherwise be imperceptible.

rendering all other competitors obsolete…

Here is that article:

https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language

Do I really need to continue stress this point about taking the above offer. Either that comes down to the last 48 hours to decide.

Thanks

Bryan

 

New course!! Building Python algo trading system with Bitcoin an crypto currency focus

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Microsoft Visual Studio Code enhanced for better Python programming

COUNTING DOWN TO THE LAST FEW DAYS!

I am winding down the LIMITED number of slots I will allow to get the current rate of my Python Algo Infrastructure Trading.

It is currently listed at $247 but may double going into EARLY next week.
Some have asked me about the content I will be adding to this:

Crypto currency additions learned lately including funding wallets and exchanges

Confirming your automated market or limit order

Confirming your Oanda connection for both Forex and CFD
trading (will work USA residents!)

JOIN Now
<<First Name>>,

This is how serious Microsoft is taking Python now to mebed it into Visual Studio.

 

https://www.theregister.co.uk/AMP/2018/07/20/microsoft_visual_studio_code_python/

 

I hardly see any languages from supporting Microsoft or any of their technology like .NET or SQL Server anymore on social media! I do think they are slowly becoming irrelevant compared to open source and their cloud competitors like Amazon AWS. Also, I have not even dare to mention any of their weird lockdown, backdoor potential with Windows 10, or any other bad corporate practices.

In order to enhance your future, you might want to look at Python as well especially if you are interested in topics like machine learning or algo/systematic trading.

Have I got a solution for you. We are entering into the last few days of this offer I explain above. My inteventory is getting low for this deal before I double the price!

We are coming down to the Wire over the LAST days
Promo Code
No expiration date
Shop Now
NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

How I deposited cash into Bitcoin into Binance with ccxt Python package

How I deposited cash into Bitcoin into Binance with a cash video playback. Bitcoin went up $1000 over the last 24 hours!! Details of the ccxt Python package is below:

Here are the notes

 

https://quantlabs.net/blog/2018/07/how-i-deposited-cash-into-bitcoin-into-binance-with-an-atm-and-cash/

Different funding anonymous options

https://www.chainbits.com/tools-and-platforms/how-to-use-binance/

For me locally (results in roughly 10% hefty fee but cheapers options below)

https://www.chainbits.com/tools-and-platforms/how-to-use-binance/

Could use this Digital Crypto Wallet

https://itunes.apple.com/us/app/coinomi-wallet/id1333588809?mt=8

(for Apple IOS but Android exists)

Need this for Binance and Coinomi

https://itunes.apple.com/ca/app/google-authenticator/id388497605?mt=8

Set up Binance API and secret key access

https://support.binance.com/hc/en-us/articles/115000840592-Binance-API-Beta

https://support.binance.com/hc/en-us/articles/115000433432-Google-2FA-Guideline

Other links to buy Bitcoin https://www.bitdegree.org/tutorials/cheapest-way-to-buy-bitcoin/amp/

To use Binance API

https://quantlabs.net/blog/2018/07/unknown-error-send-order-to-binance-exchange-with-python-ccxt-package/

To enable API, you login to follow these instructions  but understand working with unknown code from Binance crypto currency exchange. Realize that this is not an easy process like Coinbase. This is confirmation is not as slick as other brokers/exchanges I have worked with.

https://support.coinigy.com/hc/en-us/articles/360001144614-How-do-I-find-my-API-key-on-Binance-com-

https://support.binance.com/hc/en-us/articles/115000840592-Binance-API-Beta

Install ccxt Python package in your environment

https://github.com/ccxt/ccxt/tree/master/python

Also for CCXT Python package, use this source code example

https://github.com/ccxt/ccxt/issues/2552

New additions from last 24 hours:

https://quantlabs.net/blog/2018/07/bitcoin-funding-atm-coinami-wallet-coinbase/

More options but NOT tested!

Gemini Vs Coinbase

Bitcoin wiring can cost only 0.5% of the amount you transfer

https://www.quora.com/How-do-the-fees-on-Coinbase-compare-to-the-fees-on-Gemini

Gemini sounds like they are very slow to verify ID

More options even better:

Low transaction fees with exchange that gets decent reviews:

https://www.abitgreedy.com/247exchange/

https://www.abitgreedy.com/buy-bitcoin-with-prepaid-card/

How to Buy Bitcoin Anonymously & without ID

https://99bitcoins.com/buy-bitcoin-anonymously-without-id/amp/

Prepaid credit card options for Canada 

http://forums.redflagdeals.com/prepaid-credit-cards-continuously-updated-532830/

Get the LIMITED Python Algo Infrastructure course

New course!! Building Python algo trading system with Bitcoin an crypto currency focus

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

AutoGraph converts Python into TensorFlow graphs for ML Model

AutoGraph converts Python into TensorFlow graphs for ML Model

I add my view of this article within this video

View story at Medium.com

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Working Oanda v2 API tips to work with Python

 

I still find thi s broker really tough to understand as explained below. As a result, my views of Oanda API has not changed. I am trying to help out those Americans who want to do algo trading. It seems Oanda is the last broker of it’s kind to support Python API for forex and CFD for US residents. Also, they are still a market maker so watch out in terms of trusting them. Based on my experience below, nothing huge has improved in terms of getting things working via their API.  As you will read, the second link was helpful to make it work. The question is how long will these examples will still work until Oanda decide to change their API functionality yet again.

I think I finally got Oanda v20 running with Python. This broker is a complete nightmare with the various document (or lack of) to install/implement via GitHub. I tried many different ways but you may want to visit these links below:

https://github.com/oanda/v20-python-samples

You will need to ensure that you create your broker account and API tokens. These will be needed for the examples below. The link above provides a convenient Python script to create your V20.conf file. You may want to follow that process. There are also mentions of needing different virtual environments. I found this is not needed with the example code below.

https://github.com/hootnot/oanda-api-v20

The examples found in this link seems to work as long as your provide a valid V20 API token and account Id. One confusing part is use the AccountID which is the active_account found in the .conf file. I never used the username in any of the example above. As I am using Mac OS where the .v20.conf is created and stored in /Users/currentuser

 

The next though part is to filter through the response data.

As for the backtrader Python package, I did not find a Quickstart Tutorial for how to implement Oanda. Either that or it was too involved. I found another forum posting so I just decided to go native Oanda instead of using another Python package for access.

Warning on your sleazy forex broker account and crypto currency exchange 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

unknown crypto currency error: Send order to Binance exchange with Python CCXT package 

Sending order to Binance exchange with Python CCXT package

To enable API, you login to follow these instructions  but understand working with unknown code from Binance crypto currency exchange. Realize that this is not an easy process like Coinbase. This is confirmation is not as slick as other brokers/exchanges I have worked with.

https://support.coinigy.com/hc/en-us/articles/360001144614-How-do-I-find-my-API-key-on-Binance-com-

https://support.binance.com/hc/en-us/articles/115000840592-Binance-API-Beta

Also for CCXT Python package, use this source code example

https://github.com/ccxt/ccxt/issues/2552

When I run this sample with test enabled, I get this return code:

{‘info’: {}, ‘id’: None, ‘timestamp’: None, ‘datetime’: None, ‘lastTradeTimestamp’: None, ‘symbol’: None, ‘type’: None, ‘side’: None, ‘price’: None, ‘amount’: None, ‘cost’: None, ‘filled’: 0.0, ‘remaining’: None, ‘status’: None, ‘fee’: None}

Confirmed Binance login

Do understand this account is unfunded so it does confirm to work when you enter the correct API and secret keys. If the secret or API keys were incorrect, you will get this exceptions:

File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ccxt/binance.py”, line 834, in handle_errors
raise ExchangeError(self.id + ‘: unknown error code: ‘ + body + ‘ ‘ + error)
ccxt.base.errors.ExchangeError: binance: unknown error code: {“code”:-1022,”msg”:”Signature for this request is not valid.”} -1022

In the Trenches with Crypto Currencies video replay

Here is an ongoing dialogue with my most helpful dialogue PRIVATE Telegram group:

for anyone with Binance API experience. I am using this example with binance for CCXT https://github.com/ccxt/ccxt/issues/2552

Some coding examples

It seems to login ok with the proper API keys. I test a fake one which resulted as an error as expected. When I try set up these coding parameters with:

symbol = ‘XZC/BNB’

#symbol = ‘BCH/BNB’

type = ‘limit’ # or ‘market’

side = ‘buy’ # or ‘buy’

amount = 1.0

price = 1.302 #0.060154 # or None

# extra params and overrides if needed

params = {

‘test’: True, # test if it’s valid, but don’t actually place it

}

order = exchange.create_order(symbol, ‘limit’, side, amount, price, params)

It results in which is nothing:

{‘info’: {}, ‘id’: None, ‘timestamp’: None, ‘datetime’: None, ‘lastTradeTimestamp’: None, ‘symbol’: None, ‘type’: None, ‘side’: None, ‘price’: None, ‘amount’: None, ‘cost’: None, ‘filled’: 0.0, ‘remaining’: None, ‘status’: None, ‘fee’: None}

My test account has a Bitcoin balance of 0.00176200. Do I need to choose another pair with a lower value? Do I need to only use a crypto currency pair with BTC not BNB?

Thanks

also, i tried this code:

symbol = ‘XLM/BTC’

#symbol = ‘XZC/BNB’

#symbol = ‘BCH/BNB’

type = ‘limit’ # or ‘market’

side = ‘buy’ # or ‘buy’

amount = 1.0

#price = 1.302 #0.060154 # or None

price =0.00003550

but now get response of: ccxt.base.errors.InvalidOrder: binance {“code”:-1013,”msg”:”Filter failure: MIN_NOTIONAL”}

any pointers?

—–

MIN_NOTIONAL hints at your account not having enough capital/margin for the transaction. Have you verified this?

I’d suggest you try a transaction with an amount of 0.01 or something like that ← tried this but it did not correct the problem

For the currency question based on the pair:

Yes, in this case you need BNB in order to convert it to XZC. So you would first have to convert your BTC to BNB using the BNB/BTC pair.

…Yes, it sounds like you’re hitting a minimum order size restriction. Don’t forget that order sizes are denominated in the base currency of the pair (XLM in this case). One XLM is only worth 27c, so try increasing the order size to 10, or 50 or something like that.

It looks the like the minimum order size on Binance is 0.002 BTC, so try an order size greater than 55 or 60.

Source code updates compared to a few weeks

I also got this CCXT exception:

ccxt.base.errors.ExchangeNotAvailable: binance POST https://www.binance.com/api/v1/order 400 Bad Request {“code”:-1104,”msg”:”Not all sent parameters were read; read ‘8’ parameter(s) but was sent ‘9’.”}

But here is the latest source code sample:

import ccxt

exchange = ccxt.binance({

‘apiKey’: , ## these appear to work with valid keys

‘secret’: ,

‘enableRateLimit’: True,

})

symbol = ‘XLM/BTC’

#symbol = ‘XZC/BNB’

#symbol = ‘BCH/BNB’

typ = ‘limit’ # or ‘market’

side = ‘buy’ # or ‘buy’

amount = 55 #1.0 tried 0.1 but not balid

#price = 1.302 #0.060154 # or None

price =0.00003550

# extra params and overrides if needed

#removed because of this exception

#ccxt.base.errors.ExchangeNotAvailable: binance POST https://www.binance.com/api/v1/order 400 Bad Request {“code”:-1104,”msg”:”Not all sent parameters were read; read ‘8’ parameter(s) but was sent ‘9’.”}

# File “testBinanceOrder.py”, line 26, in <module>

# order = exchange.create_order(symbol, ‘limit’, side, amount, price, params)

# NameError: name ‘params’ is not defined

params = {

‘test’: True # test if it’s valid, but don’t actually place it

}

order = exchange.create_order(symbol, typ, side, amount, price, params)

print(order)

note the new exception of Not all sent parameters were read; read ‘8’ parameter(s) but was sent ‘9’.”

i am sending a total of 9 of but what am I supposed to eliminate? i tired the extra params but that did not help

I finally got something working with this https://github.com/ccxt/ccxt/issues/298

Can you post verbose output for it?

Try a minimal example:

import ccxt
binance = ccxt.binance({
    "apiKey": "YOUR_KEY",
    "secret": "YOUR_SECRET",
    "verbose": True,
})
print(binance.create_market_sell_order('BTC/USDT', 0.00711675))


This also seems to work fine as well:

#print(binance.create_market_sell_order(‘BTC/USDT’, 0.0001))
print(binance.create_market_buy_order(‘BTC/USDT’, 0.00001))

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Anyone ever use Quant Rocket? Support Python and Interactive Brokers 

 

I find these solutions and platforms can be useless compared to coding your own. If you roll your own, you will be able to define and control your own trading techniques. You will understand them better so don’t be lazy. This does support Python though.

I am still hearing about those use this QuantRocket or something similar?

https://www.quantrocket.com

 

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Overview of backtrader with Python 3 for a complete algo trading system

There are numerous part of this video but I try to explain how to install backtrader which I got running on Python.This can also be used in conjunction to build a out a complete algo trading system.  This project clearly is growing quickly to replace Quantopian and maybe Quantstart. It is 100% in Python with some great example Quick Start guides to get you up and running. I am sure the community is up to par by now.

Oanda? Really so here is why ?

Also, I explain how I may go back to Oanda( ugh and yuck) as a quick and easy gateway for forex or CFD trading. This  project will ease the intro to a forex algo trading system with 100% Python without the complex extra process of including Java with the JForex platform from Dukascopy. Also, it seems American residents really only have Oanda as the only remaining choice to use Python. It sucks I know but this includes the huge market interest for using the 100% Python option for an algo trading system. Just remember Dukascopy does not allow USA customers so I can only use Oanda for now. My opinions of Oanda has not changed. I just wish there was a better option to implement.

Also, the Python backtrader project support Oanda and my eventual migration to Interactive Brokers for eventual options/futures. Always remember this asset class is used by institutions and is recession proof as well.

Spoiler alert

To save you time, I also tried to install a GUI project built for backtrader called Omega UI.

https://github.com/OmegaTrading/OmegaUI

Most of the video focuses on this attempt but this project clearly needs a tutorial or document to get it running. This portion was a chunk of time wasted so don’t bother.

Note: I plan to only use backtrader for the broker connection only as explained above. I don’t plan to change the strategies I have been working over the last number of months

I will be adding the productive learning to my course as explained below

New course!! Building Python algo trading system with Bitcoin an crypto currency focus

Links

https://www.backtrader.com/docu/quickstart/quickstart.html?highlight=optimize

https://github.com/OmegaTrading/OmegaUI

https://www.backtrader.com/features

https://github.com/backtrader/backtrader

https://stackoverflow.com/questions/3387695/add-to-python-path-mac-os-x

https://superuser.com/questions/273966/how-can-i-uninstall-using-homebrew

https://marketing.plot.ly/products/cloud/

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Most reliable candlestick patterns with TA-Lib Python demo

Most reliable candlestick patterns with TA-Lib Python demo

As continuation with the 2 patterns I mentioned earlier which include Marubozu line and others listed below.

Here are the links from my video

https://mrjbq7.github.io/ta-lib/func_groups/pattern_recognition.html

http://thepatternsite.com/BlackMarubozu.html

http://thepatternsite.com/RickshawMan.html

Market reversal with Marubozu Line and Adam and Eve

Reliable candlestick patterns for TA-Lib pattern recognition acts as a bullish reversal

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Is this Python code of linear regression really machine learning

Is this Python code of linear regression really machine learning? Seriously, why do less knowledgable people just rely on the result of some popular machine learning framework like TensorFlow. Don’t you think it is wise to understand the underlying math? I have used this stuff with MATLAB well before the terms big data and machine learning  became popular. I am no expert here but I would like to have some experts add their opinion on it.

Looking for input

Comment away in my video where I am wrong. I like to learn what you think. All I ask is be respectful about it

Robert Pardo book for forward walking

https://onlinelibrary.wiley.com/doi/book/10.1002/9781119196969

https://en.wikipedia.org/wiki/Linear_function

TensorFlow and Nutonian machine learning for algo trading tips

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!