Category Archives: Featured

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!

Ken Griffin’s $30B hedge fund has out performance vs industry this year

If you looked at these crummy returns, you would think this performance from the big dogs of the hedge fund industry is sort of sad. I am not an expert here but I am hoping to get my trading daily goals will be at least 0.5% psotive moves against my portfolio. However, when you have the most intelligent industry managers with such low performance, it make me wonder who are they to attack the crypto currency asset class space? I do see daily tiny opportunities to make the goals I would like to achieve. See this CNBC article here:

https://www.cnbc.com/amp/2018/07/12/ken-griffins-30-billion-hedge-fund-citadel-is-outperforming.html

Corrections help

Someone in my Telegram group corrected my views on both on Markowitz and Sortino. I like this type of criticism since it improves my view of algo trading. Also, you need to keep an open mind to this as well. If you want to see these corrections, go here:

http://quantlabs.net/blog/2018/07/corrected-markowitz-sortino-views-enhanced-portfolio-management/

This will greatly improve my results on the Quant Analytics service I am running.

Thanks Bryan

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!

Psuedo code for automated market entry open positions and exit for crypto currency 

Working on this automation code for a watchlist for both entry and exit. This includes monitoring for open positions.

The steps

#***watchlist for entries
#query for watchist
#iterate through based on each stock pick combo (from report) with no open positions
#use parameter to meet condition of market order
#if met, put position and flag combo as open position since it is put on (check rick management using tool like Kelly Criterion)

 

#****watchlist for exit
#query for open positions
#iterate open positions where ATR needs to be met in order to close/exit

 

Let maximise our crypto currency asset class trading positions with portfolio optimization

 

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!

Who is the smartest hedge fund manager ever?

Who do you think the smartest hedge fund manager is? Some say James Simons of Renaissance Technologies. You can read other opinions here:

https://www.quora.com/Who-is-the-smartest-hedge-fund-manager-ever

Who do you think it should be? Let me know by responding!

What am I gong to do about it?

As for me, I am making some great strides in this overall strategy:

1. I included a video on how I am able triple expected returns via portfolio optimization.

2. I am working on how to optimally enter and exit the crypto currency exchanges for multiple positions.

3. Use risk management techniques to help protect your account against down market days. Imagine if you were able to do the opposite by maximizing when the markets are constantly up?

Many videos and other files will be provided very soon which will be part of my Quant Analytics service. You may to consider joining right as soon as possible.

JOIN NOW

Thanks Bryan

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!

Intriguing Failing of Convolutional Neural Networks: Which asset class?

As explained in this Uber engineering article, it seems that this Convolutional Neural Networks has failed them. Some folks have come to asking about this. If you saw yesterdays email, it seems that Long Short Term Memory was more effective. I am not machine learning expert but I am asking for anyone’s experience here. Let me know how you find these two methodologies can be used for which algorithmic trading asset class. Here is the article

https://eng.uber.com/coordconv/

Let maximise our crypto currency asset class trading positions with portfolio optimization

This 15 (approx) minute video showcases my portfolio optimizer which I have shown before. Do realize this can be applied to any asset class. You can always search on my Youtube channel for ‘portfolio’ as hinted in this video. The idea here is to showcase you could triple your expected return by using the appropriate strategy type with proper optimally weighted positions. This is all shown in the video. I would say this is one of the biggest reasons to automate your strategy and trading. No human can do this if you were to allocate a higher number of positions across multiple asset classes for the day. You could even run this script every few hours if I wanted to allocate positions every X hours. I would have to feel pretty lucky to do that.

Look back matters among other parameters to consider

Do understand your analysis look back also matters depending on your overall asset class performance. As of now, crypto currency has taken a major beating so it might be wise lower the loopback to let’s say 7 days vs 30 as shown in the earlier part of the video.

Note that this can be used on any asset class based on the historical performance of standard open, high, low, and close market data. I use Binance exchange which only allows long only but could also include portfolio strategy methodology of Markovian Long/Short, Markovian market neutral, and Markovian Market Neutral.

Let me know what you think of this.

Let maximise our crypto currency asset class trading positions with portfolio optimization

As usual, this will be part of the Quant Analytics service to enhance your profits so see below if interested

Quant Analytics

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!

Let maximise our crypto currency asset class trading positions with portfolio optimization

This 15 (approx) minute video showcases my portfolio optimizer which I have shown before. Do realize this can be applied to any asset class. You can always search on my Youtube channel for ‘portfolio’ as hinted in this video. The idea here is to showcase you could triple your expected return by using the appropriate strategy type with proper optimally weighted positions. This is all shown in the video. I would say this is one of the biggest reasons to automate your strategy and trading. No human can do this if you were to allocate a higher number of positions across multiple asset classes for the day. You could even run this script every few hours if I wanted to allocate positions every X hours. I would have to feel pretty lucky to do that.

Look back matters among other parameters to consider

Do understand your analysis look back also matters depending on your overall asset class performance. As of now, crypto currency has taken a major beating so it might be wise lower the loopback to let’s say 7 days vs 30 as shown in the earlier part of the video.

Note that this can be used on any asset class based on the historical performance of standard open, high, low, and close market data. I use Binance exchange which only allows long only but could also include portfolio strategy methodology of Markovian Long/Short, Markovian market neutral, and Markovian Market Neutral.

Let me know what you think of this.

As usual, this will be part of the Quant Analytics service to enhance your profits so see below if interested

Quant Analytics

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!

Deep Learning in Finance: Most effective methods for returns and portfolio construction

It seems that deep learning has been questioned when it comes to financial modelling. A decent article came out from a WorldQuant. This Medium article covers how to improve your forecasting using both in and out samples. It also covers:

1. Return Prediction comparing ARIMA, VAR, Deep Regression, Convoluted Neural Networks, and Long Short Term Memory.

2. Portfolio Construction with deep learning and deep index.

Get more info here

Overview of backtrader with Python and GUI project

I also tried to implement a GUI Python project that sat on top of backtrader. It seems I did not get anywhere after an hour. Sorry for the spoiler alert but you can learn how to install backtrader by watching the first part of the video.

That is here with helpful links

Lastly, I have managed to put up the purchase button for my Quant Analytics service which will be frequently updated with all the Crypto Currency reports I have been working over the last few months.

Quant Analytics

Gold Price Forecasting Using Python Machine Learning

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!

Are these potential cryptocurrency pair market conditions worth noting

I tried my reports as explained in the past few weeks. This include various market conditions that I only came across 2 pairs of interest. I may need to develop a watchlist script that will place orders when conditions are met.

Market conditions for an order

As with no difference in a pair trading, you need to use a benchmark to compare your crypto currency pair against. This will be BTCUSD (Bitcoin/US Dollar) as that is the grand daddy in this asset class. If you have followed me years ago, I I use indicators like Beta for those outperform the benchmark. We can place a market order using position sizing from my portfolio optimizer I have demoed numerous times.

 

 

Only Samples for download

These files attached are the only samples I will include to see both my big crypto currency trading report as well as my spreadsheet.

These sample files will be generated DAILY from within the Analytics service

Intro to massive report for automated crypto currency trading

Downloadable file samples

CryptoLong

CryptoRank

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!

LIVE Overview of spreadsheet data for crypto currency optimal automated trading

This will be covered live at youtube.com/quantlabs live on Mon Jul at 7PM EDT. More details at youtube.com/quantlabs

Let me present the short video

This includes the details of how you can use my spreadsheet from the Quant Analytics everyday

Hi there,

You are invited to a Zoom webinar.
When: Jul 9, 2018 7:00 PM Eastern Time (US and Canada)
Topic: LIVE Overview of spreadsheet data for crypto currency optimal automated trading

Please click the link below to join the webinar:
https://zoom.us/j/303876354

Or iPhone one-tap :
US: +16465588656,,303876354# or +16699006833,,303876354#
Or Telephone:
Dial(for higher quality, dial a number based on your current location):
US: +1 646 558 8656 or +1 669 900 6833
Webinar ID: 303 876 354
International numbers available: https://zoom.us/u/bUN9jPlP9

 

Important notes of spreadsheet columns:

slope : slope of the regression line

intercept : intercept of the regression line

r-value : correlation coefficient

p-value : two-sided p-value for a hypothesis test whose null hypothesis is that the slope is zero

stderr : Standard error of the estimate

https://stackoverflow.com/questions/9538525/calculating-slopes-in-numpy-or-scipy

Understand the relationship: https://www.researchgate.net/post/What_is_the_relationship_between_R-squared_and_p-value_in_a_regression

Extra momentum as calculated from: https://github.com/bukosabino/ta

 

Latest learning on Algo trading with Crypto currency with Binance market data

 

 

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!