A Beginners Guide to Forex Trading Bots and Python – Strategy and Tactics

5/5 - (4 votes)
A Beginners Guide to Forex Trading Bots in Python – Strategy and Tactics

In our first lesson, I made the point that Forex trading is a “zero-sum game”, and that is why I would learn Python first while I was starting to build as much knowledge about trading the markets as I could.

Python programming is the exact opposite.  If you are writing or teaching code, you are actually adding value to the other person/persons involved – a good reason to start there first!

Strategy vs Tactics in Trading and Python

We were already talking about strategy and tactics in our last lesson, and you may not have really even noticed.

The long-term plan and the ultimate end, in this case, might be becoming an entrepreneur, having your own business, being financially independent, or being a rocket scientist.

This long-term plan is our strategy.

The daily, weekly, monthly, and yearly concrete steps we take, those short-term goals that in our case will lead us to a career as a Python coder or successful trader, will be our tactics.

👉 Recommended Tutorial: Bitcoin – Trading Moving Averages or HODL? A Python Script Uncovers the Answer!

A Solid Tactical Plan for Learning and Implementing Python (or anything else)

Get familiar with the “lingo.”

When learning anything new, we need to know what the experienced people are talking about.  The terminology of the field.  I have not found an exception to the fact that all professionals have their own “language” when they speak of their field.

🏃‍♀️ Action step:  Google everything you can find on Python and then scan the information quickly and create a giant list of the words or terms you don’t understand.  Then go back and look up each one separately to get the meaning.  A one-hour session like this can be super powerful.

Then do the same with Forex trading.

Start working on actual real-world projects.

Ask yourself a simple question, “What problems or tasks could I streamline in my work or for someone else to make life easier using Python?” 

Think outside-the-box on this one and don’t be afraid to take some chances.

Stretch your brain.

If you went through the first article you should be well on your way to getting the basics of Python.  No matter what you are learning, a musical instrument, martial arts, Python, or Forex trading, a solid foundation in the basics is the important first step.

But to really move ahead you need to push out of your comfort zone.  This can be challenging and frustrating, as I’ve said before, but push until you hit the wall and then pull back to your comfort zone.

How 10x Reading Helps Me Learn Anything Faster

Realize the “Blossoming Effect”

When you are pushing yourself to be “superhuman”, (and I hope you are) each time you study one thing, a whole bunch more topics pop up.

(We could call this the “rabbit hole syndrome”). 

Stay focused on your plan and take note of how these other ideas could be helpful in the future – you can always go back later.

Consistency again.

Yes, consistency again. I know that I brought this up in the first article. I’m probably going to talk about consistency in every article that I write on these subjects because it’s so important.

🕧 Do something every single day. No weekends, no holidays.

Now let’s do some brain-stretching with Python!

Another booming niche to consider for your Python freelancing career is the data science arena, and the Python libraries are a great place to start.

Becoming a NumPy & Pandas Data Science Freelancer on Upwork ... to Michael

The cool thing is, that most decisions we make when developing a Forex trading strategy and our tactics to support it are going to be data-driven.  Another great way learning Python and becoming a trader are connected!

I’ve compiled a list of resources for some of my favorite libraries, and I give a beginner demo on Anaconda, Jupyter Notebooks, Pandas, Matplotlib, and others in the video of this lesson.

One other Python feature that we need to get familiar with is the dictionary, and I will cover that in the video tutorial for this lesson.

That should give you plenty to work on with Python – now let’s get to the trading section of the lesson.

NOTE:  The deeper we dive into the actual coding and trading sections of this project the more I will need to use video for demonstrations – there is a lot of this information that is better shown live and hands-on.

The Same Plan for Forex Trading (or anything else).

Refer to the above plan to get going with Forex trading.

Continuing with the data theme, how do we begin to formulate a Forex trading strategy and the tactics we use to carry it through?  To begin, the General gathers as much information (data) as his advisors can collect.

This is where the Python data libraries come in – we need to collect, organize and analyze our data to begin formulating a plan.

The Big Picture Forex Strategy (with or without bots)

Many of the high-frequency trading bots I see are running very fast on a 1-minute chart.  Entering and exiting trades rapidly for small profits.

My experience – I want you to know that this is purely subjective from my own experience and I’m not trying to say you cannot trade this way.  If the 1 min chart works for your system, then by all means go for it.

My first round of bot trading was on the 1 min chart, and it did make a lot of small profits – HOWEVER.  When the bots got into trouble the losses would eat those profits fast and then some.

This is when I started to work on my own system.  Let’s see how to start building your style.

Questions to ask:

1. The General takes the 30,000 foot view?

Get high above the battlefield and get the whole picture.

In the case of Forex, the 30,000-foot view is on a daily, weekly, or even a monthly chart – you are “zoomed out.”

Let me give you an example with a sample chart:

As I said in lesson 1, I prefer candlestick charts because they are very visual and can tell a story.

Each candle represents a time frame.  If this is a 1 min chart, each candle is one minute.  So this would represent the last 36 minutes of price action.

Now zoom out – we switch to a daily chart and now this represents the last 36 days!  These two charts may look very different, but the price is fractal in nature and the parts are contained in each view.

Steve Nison is considered an expert on candlestick charts and has some good, free training on his website.

2. Which currency pair(s) am I going to trade?

Currencies are traded in pairs.  You might be familiar with the EUR/USD pair.  The relative value between the Euro and the U S dollar.

TIP:  Pick ONE of the major currencies and become an expert.  Learn what makes it strong or weak and then pair it up accordingly (i.e. strong USD – weak AUD == BEAR AUD/USD).

3. Do I base my strategy on fundamentals, technicals, or a combination of both?  Do the robots care?

The idea of fundies vs technicals is an ongoing battle between traders, and I have heard compelling arguments for both sides and a blend of the two – bottom line for us is that we are going to use it all, and then create a robot that is unaffiliated!  – is there any other kind?

4. What is my capitalization? (how much money do I have?)

It all comes down to margin and trade size.  That’s why we are starting with a demo account and then moving to the smallest trade size available ( 0.01 –  one micro lot).  After you have tested your system you want to have some skin in the game using real money.

5. What is my risk tolerance profile?

Do you freak out at the thought of losing money, or do you take your extra savings and go to the nearest casino? (casino not recommended)


We see a lot of “Cowboys” on the internet, but the truth is that the great traders are cool, calculated, and calm, because they have done the math – one trade is not going to make or break them!



We covered a lot in this lesson and it should give you plenty to work on until part 3.

If I had to identify the most essential idea though, it would be the idea of having a plan.  Just as the General cannot go to war without a detailed plan, we cannot learn new skills and reach our goals without a clear, WRITTEN plan of attack. 

Trading without one is certain death.

Write it down and make it a work in progress, updating and checking back in to see what’s next and to savor the victories – keep close track of both.

Most great traders have a freakish desire to be spectacular – they just do it in a quiet manner!

Spend a few minutes meditating on the “superhuman  you.”  Because in part 3 we are going to take it to the next level.

When we started this series, I told you I would learn Python first because it was easier.  That’s only partly true – you see, what we are about to dive into to actually create an effective bot is moving into advanced Python ideas.  Don’t worry if you don’t feel ready – when something is new you NEVER feel ready – just go for it and remember: YOU ARE GOING TO TRADE A DEMO ACCOUNT UNTIL YOU HAVE GOTTEN VERY GOOD AT TRADING. (Or your bot has!)