Building a profitable trader bot stepbystep
Congratulations! You have just committed yourself to one of the most challenging exercises today. Algorithmic trading is a fascinating world. Its learning will allow you to push the boundaries of technical analysis and trading.
I wrote this book to help you design your trading system using Prorealtime
As a first step, I will provide you with the theoretical and conceptual basis you need to develop trading algorithms. Then, stepbystep, I will lead you in programming your trading bot. After that, a chapter about the backtest analysis will explain how to reduce the risk of overfitting.
I created a machine learning model specially adapted to optimize automated trading systems, which you can easily use to configure your trader robot.
After running on a real account, you will have to manage your automated trading systems. There are some management rules that you need to know and strictly apply. These rules will tell you when to start and stop a trading system.
BONUS: Get the source code of a complete trading strategy!
> SATISFIED OR MONEY BACK <
Original price was: €49,00.€39,00Current price is: €39,00.
Description
Second Edition
The present book is a complete revision of the previous version representing a real improvement for the reader. Most of the chapters have been rewritten, and many new thematics have been appended:
 – Correlations between technical indicators
 – Combinatorial and arrangement
 – Chap recognition using Euclidian distance
 – Multitimeframes fractal correlation
 – Voluntary underoptimization model
 – Overoptimized strategy arbitrage
 + Source code of an automated trading strategy
 + Source code to recognize a Double Bottom
This book is calling to become a musthave reference work for anyone interested in trading system development using Prorealtime.
Date of publication  2022/04/28 
Editor  Selfpublishing 
Format  EBOOK PDF 
Number of pages  638 
What about the news?
1. How to choose the best technical indicator?
Using uncorrelated indicators improves market reading and decisionmaking. I provide you with a code calculating the correlation between two technical indicators. That will help you better choose your indicators for manual trading as automated trading.
2. Find the best moving average crossing
Thanks to an algorithm built on the arrangements without repetition, you will find the most profitable moving average crossing. The source code is easy to use and can be applied to any trend indicator.
3. Chartist figure recognition
I completely rewrote this chapter. I provide you with three algorithms capable of recognizing any chartist figures, from the simplest to the most complex. The first algorithm works with correlation, the second with Euclidian distances, and the third with Hausdorff distance. Mathematic distances are particularly efficient with chap recognition. The source codes are detailed and explained. You simply have to put your preferred figure in the dataset to create your chartist indicator.
4. Multitimeframe fractal arbitrage
In this new chapter, I introduce an arbitrage algorithm between two timeframes. It calls multitimeframe fractal correlations to anticipate a bullish reversal. This strategy works on most of the main indexes, such as the S&P500, the Dow Jones, or the DAX 40.
5. The underoptimized model
This model is straightforward to understand and use. It consists of voluntary degrading the performance of a backtest to increase the probability of future gains.
6. Overfitted strategy arbitrage
It is the opposite of the previous model. An overoptimized strategy has more chance of losing in the future than winning. This model tries to turn the risk of loss into an expected gain. It consists of voluntarily overoptimizing a strategy to open reversal entry in the future. However, you will need to respect some rules to apply this model.
Table of Contents
Introduction
 What is algorithmic trading?
 Why have I chosen to create trading systems?
 What is the style of trading that I have chosen?
 An example of automated building entries
 Automated trading expectations
 Limitations and possibilities of automatic trading
 Differences between automatic and autonomous systems
 Unadaptability of automatic systems
 The problem of the unadaptability to the environment
 How to resolve the automated system’s unadaptability?
 The extreme “complexity versus simplicity”
 The management rules
 The global context
 The decisionmaking variables
 Why Prorealtime?
 The programming language of Prorealtime
 Properties of the programming language
 ProOrder Autotrading functioning
 On which assets can I launch a bot?
 The programming language of Prorealtime
Handling the Prorealtime platform
 Overview of the development environment
 Development and test environment
 Backtest result
 Execution following environment
 ProOrder Autotrading window
 Opening entries window
 Create and launch the first test
 Create a ProOrder system
 Probacktest and Automated Trading
 Probacktest & Automated trading editor
 Create by programming
 Explanation of example code lines
 First bloc
 Second bloc
 Create a ProOrder system
The great concepts of algorithmic trading
 The three pillars of automatic trading
 Efficiency
 Definition
 Loss of efficiency
 Maintain the efficiency of a system
 Concept of software engineering
 Effectiveness
 Definition of the effectiveness
 Complexity
 Classes of complexities
 Reduction of dimensionality
 Reduce the dimensionality thanks to the booleans
 The principal component analysis
 Conclusion about the dimensionality reducing
 Reduction of the granularity
 The MontéCarlo algorithm
 AlphaBeta pruning
 Effectiveness and complexity – For further
 The “ideal” number of technical indicators
 Effectiveness and complexity synthesis
 Performance
 What is the Performance?
 Involve the risk with the performance
 Sharpe ratio
 Be careful with the latent volatility
 Conclusion
 Efficiency
 Risk management and integration
 Risks related to the automated trading system
 Exposure to the financial risk
 Financial Risk integration
 Example of risk integration
 Trading and Gambling
 The heads or tails game
 Heads or tails game without fees
 The heads or tails game with fees
 The roulette gamble
 Roulette gamble without the green color
 The Martingale roulette gamble with the green color
 Conclusions Trading and Gambling
 The transaction cost
 The risk of a transaction
 The spread/expected gain ratio
 The heads or tails game
 Strategy versus Tactic
 Definitions of strategy and tactic
 What is a strategy?
 What is a tactic?
 Strategical approach
 Arbitrage opportunity
 Big guys versus little traders
 The actions of algorithms and robots
 The target prices
 The trading strategy cycles
 Conclusions about the strategical approach
 Tactical approach
 Zerosum games
 Von Neumann Minimax theorem
 MiniMax Algorithm
 Is trading a zerosum game?
 Why the tactical approach?
 Should the strategy approach be rejected?
 Tactic and strategy meshing
 Your two first tactical choices
 Choice of your broker
 Thin market versus thick market
 Definitions of strategy and tactic
 The five activities of algorithmic trading
 Automated strategy researches
 Automated systems design
 Development and unitary tests
 Backtest and validation
 Automated system management
I. Automated strategy research
 Decision tree
 Find an entry point
 Decision tree modelization
 Complete code of the research system
 Test running
 Short strategy version
 Source code for a short strategy with three indicators
 Running and interpretation of the result
 Find an entry point
 Combinatorial and arrangement
 Try all the crossing combinations
 Arrangements without repetition
 What is an arrangement?
 Find the best moving averages crossings
 Source code to find the best crossing
 Chartist figures recognition
 Recognition by correlation
 The steps of recognition by correlation
 Double bottom indicator source code
 Double bottom detection example
 Open a long entry after a double bottom
 Source code of the double bottom algorithm
 The limitation of the recognition by correlation
 The Euclidian Distances
 A few words on Euclid
 What is the Euclidian distance?
 Chap recognition using Euclidian distance
 Source code of the green hammer recognition
 Majority vote principle
 Generalization of the recognition algorithm
 Double bottom recognition using distances
 Source code of the double bottom recognition
 The limitation of the Euclidian distances
 The Hausdorff distance
 A few words on Hausdorff
 What is the Hausdorff distance?
 Hausdorff distance formula
 Sequences of the Hausdorff algorithm
 Source code of the Hausdorff distance recognition
 Conclusions about chartist figure recognition
 Recognition by correlation
 Multitimeframes fractal correlation
 What is a fractal?
 The fractal on the market
 How to exploit fractals on the market?
 Calculate the correlation between two timeframes
 Source code to calculate a multitimeframe correlation
 Source code of a multitimeframe fractal arbitrage
 Conclusion about fractal arbitrage
 Push the boundaries of the strategies research
II. Automated trading system conception
 Creation cycle of an automated trading system
 The conception cycle
 Model of conception
 The Cascade model
 The V cycle model
 General conception
 Description of the strategy
 Decisional description
 Functional description
 Management rules description
 Example of a general conception
 Description of the strategy
 Detailed conception
 Pseudocode example
III. Development of an automated trading system
 Integrate the transaction cost
 DAX spread table
 IG Market spread
 Global architecture of the robot
 “Parameters and initialization” Block
 “Entries opening” Block
 “Opened entries management” Block
 “Emergency stop” Block
 Parameters and initialization of the variables
 Definition of the parameters
 PRELOADBARS
 CUMULATEORDERS
 FLATBEFORE and FLATAFTER
 Management of the time frame
 Choice of the time frame
 Multi timeframe
 Rebuild a superior time frame
 The tickbytick mode
 Tickbytick mode and reliability of a backtest
 Perception and vision of the market
 Human perception
 Market perception by a system
 Define an economic and market calendar
 Market trading hours
 Market trading days
 Vacancy and closed market days
 Particular days
 Saturday and Sunday cases
 Create a “calendar condition”
 Central bank days
 Limit the number of openings by day
 Source code to limit the number of openings by a day
 The ideal number of entries by day
 Initialization and reinitialization of the variables
 INTRADAYBARINDEX
 Undefined initialization
 Definition of the parameters
 The types of markets
 Identify the type of the market
 The six types of markets
 End of the trend and acceleration
 Choose a type of market
 Measure the market trend
 Trend indicator slope
 Moving average
 Linear regression
 Linear regression versus Moving average
 Quadratic regression
 Smoothing – lag adjustment of the technical indicators
 The three technical configurations generating errors
 Eliminate the false signals thanks to the smoothing
 The Smoothing/lag ratio
 Avoid the false signals using the standarddeviations
 Reflexion on the linear and polynomial regressions
 Example of bullish trend market detection
 Interpretation of the result
 Measurement of the market volatility
 Measurement of the historical volatility
 Implicit volatility
 Market characteristics of the raw materials
 Supply and demand balance
 The seasonality
 The storage capacities
 Conclusions of raw materials
 Measure the acceleration of the market
 Measuring price direction
 Measuring price acceleration
 Measure the acceleration of other indicators
 Identify the type of the market
 Open an entry
 Configure the stoploss and the target
 Static positioning of the stoploss and the target
 Dynamic setting of the stoploss and the target
 The Grid algorithms
 Algorithm of stoploss range adjustment
 My choice about stoploss and target positioning
 Opening entry instructions
 Structure of the opening entry instruction
 Open a long or short entry
 Number of contracts by order
 The types of entry opening orders
 Trigger range orders
 The validity period of the LIMIT and STOP orders
 The time between two entries
 Entry status of your trading system
 How to use the entry state variables?
 Entry opening conditions
 Market conditions
 Conditions of your trading strategy
 Configure the stoploss and the target
 Manage an opened entry
 Stoploss and target initialization
 The four types of stoplosses
 The four types of targets
 Example of stoploss and target positioning
 Stoploss and target management
 Modification of the stoploss and the target
 Inactivation of stoploss and target
 Trailing stoploss
 Program a trailing stoploss
 The two types of trailing stoploss
 Trailing stop algorithm
 Reinitialization of the variables
 Loss of efficiency risk
 Unexpected entry opening risk
 Create a reset block
 Target overwriting
 Chose a moving average as a target
 Algorithm of the Hundreds
 The indicator of the hundreds
 Algorithm of the rounded price detection
 Choose the hundred as a target
 Monthly pivot
 Calculation method of the pivot
 Monthly FIBONACCI pivots
 Profit securing algorithm
 Needed variables for the profit securing algorithm
 Management and adjustment of the STOP order
 Replace the target with a stop order
 The target order weakness
 Profit securing conditions
 Algorithm of the conditional stop selling activation
 Enrich the algorithm of the stop selling order activation
 Stoploss and target initialization
 Emergency stop of a trading system
 The QUIT instruction
 Warning on the QUIT instruction
 Example of a QUIT instruction
 When to stop a trading system?
 Stop due to excessive volatility
 Stop due to breakout of support
 Stop due to excessive losses
 The QUIT instruction
IV. Analysis of the backtests
 Launch a backtest on Prorealtime
 Reading of a backtest result
 The analysis metrics of a backtest
 Gains and losses
 Distribution of the trades
 Times
 Advanced widgets
 The analysis metrics of a backtest
 Measure the efficiency of a trading system
 Identify the common denominator
 Is your trading system overoptimized?
 The two main risks of overoptimization
 Example of overoptimization by an excessive precision
 Example of overoptimization by generalization error
 Global standarddeviation of your strategy
 Too large standard deviation
 Acceptable standard deviation
 Earnings distribution
 Too concentrated earnings distribution
 Dispersed earnings distribution
 The measure of Tracking Error
 Tracking error of a strategy
 How to interpret the tracking error?
 The profit/loss ratio
 Too low profit/loss ratio
 Consequences of a too low profit/loss ratio
 Profit securing
 Time in the market
 The standard deviation of time in the market
 The time in the market increasing
 Duration of latent loss
 The first visual controls summary
 The two main risks of overoptimization
 The stresstests
 Spread increase
 How to conduct this stress test?
 Simulation of spread increasing
 Simulation running with Python
 Simulation of spread increasing on Probacktest
 Overfitted strategy behavior
 Underfitted strategy behavior
 Summary of spread increasing simulations and tests
 Trigger stop loss by a single point
 Why do this test?
 Method of the test
 Generalization of this methodology
 Trigger stoploss summary
 Simulate the back to heads or tails
 Asymmetrical strategy example
 Back to heads or tails of an asymmetrical strategy
 The example of the symmetrical strategy
 Back to heads or tails of a symmetrical strategy
 Make your simulations thanks to Python
 Conclusion about back to heads or tails test
 Series of losses and worst possible case
 Estimate the series of losses cost
 Worst possible case simulation
 Flash crack simulation
 EUR/CHF Flash crack of 2015/01/15
 Stresstests summary
 Spread increase
 Optimization of the variables
 Optimizer of the variable functioning
 Launch the optimizer of the variables
 Open the window of the optimizer
 Optimizer window
 Optimize a variable
 Add a variable to the optimizer
 Configure the interval and the step
 Run the optimizer
 Reading the result of the optimizer
 Optimization of the variables and tickbytick mode
 Sort the result of the optimizer
 Deeping the interval of values
 The orphan values
 How to know if a value is an orphan?
 Orphan values conclusion
 The Gradient Descent algorithm
 Concepts and definitions
 Definition of the GradientDescent algorithm
 Convex and nonconvex functions
 Mean Squared Error
 Cost function
 The Cost of error
 Local and global minimum
 Local and global maximum
 Why use the GradientDescent algorithm?
 How to use the Gradient Descent algorithm?
 Gains evolution
 The gain curve
 Concave adjustment of the result using Excel
 Create a chart thanks to Excel
 Localize the global maximum
 Choose a value
 The limits of the Gradient Descent algorithm
 The displacement of the minimums and the maximums
 Gradient Descent Summary
 Concepts and definitions
 WalkForward Optimization
 Concepts and definitions
 What about the WalkForward Optimization?
 Temporal series
 Training set
 Validation set
 WalkForward Efficiency
 Run a WalkForward Optimization
 Activate the WalkForward
 First WalkForward optimization result
 First interpretation of the result
 Second WalkForward optimization
 Second WalkForward optimization result
 Second interpretation of the result
 Unique event cancellation
 Third interpretation of the result
 Interpretation of the WalkForward optimization result
 The limits of the WalkForward optimization
 WalkForward optimization Summary
 Concepts and definitions
 Stochastic modeling
 Concepts and definitions
 Definition of the stochastic test
 Purpose of the stochastic test
 Application of the test on Prorealtime
 How to process stochastic modeling on Prorealtime?
 Validation requirements of the test
 What are we trying to find?
 Unitary test of stochastic modeling
 Initial problematic
 Mini trendfollowing strategy example
 The unitary stochastic modeling goal
 Unitary test running
 Interpretation of the result
 Global Stochastic modeling test
 Global Stochastic modeling test goal
 Global test running
 Result interpretation
 Result of the global stochastic modeling test
 Generalization of the stochastic modeling
 The limitations of the stochastic modeling
 Conclusion about the stochastic modeling
 Concepts and definitions
 GDSM Optimization model
 Presentation of the GDSM model
 Definition of the GDSM optimization
 Why use the GDSM optimization?
 Application of the classical model to the financial market
 Functioning of the GDSM modeling
 Selection of the possible values
 Validation of possible values
 The limits of the GDSM
 Summary of the GDSM optimization
 Presentation of the GDSM model
 Voluntary underoptimization model
 Example of an automated trading strategy
 Description of the trading strategy
 Source code of the entry openings
 Optimization sequence
 Test period division
 Stoploss and target optimization
 Optimization of the stoploss
 Result of the stoploss optimization
 Optimization of the target
 Target optimization preparation
 Result of the target optimization
 Overfitted configuration of the strategy
 Result of the overfitted backtest
 Backtest and reality comparison
 Find the fair optimization of a trading system?
 Deteriorate the equity curve of the backtest
 Underoptimize the stoploss and the target
 Result of the underoptimized backtest
 Validation of the optimization in the future
 The limitations of the underoptimization model
 Risk management accordance
 Definition of an “underoptimized” value
 What parameters need to be underoptimized?
 Voluntary underoptimization summary
 Example of an automated trading strategy
 Overoptimized strategy arbitrage
 What is an overoptimized strategy arbitrage?
 How to overoptimize a strategy?
 Arbitrage result
 Interpretation of the result
 Model of overoptimized strategy arbitrage
 Entry opening after the entry point
 Entry opening delayed
 Add a delay before the opening
 Add a time condition
 Example of strategy with delayed entries
 Source code of a delayed trend following strategy
 Optimizer of the variable running
 Interpretation of the result
 Entry opening delayed
 Build a position in the market
 Why build a position?
 Risk smoothing
 Countering the stoploss hunt
 How to build a position?
 Why separate your systems to build a position?
 The rules to build a position
 Choose an appropriate strategy
 Define an opening range
 Recheck the market conditions
 Source code to build a position
 Example of position building
 Example of a built position
 Why build a position?
 Efficiency environment
 Concept and definition
 Limit the risk of uncertainty
 The equation of the efficient environment
 The voluntary underoptimization of the system
 Management of trading systems
 The limitation to the known market
 Normal functioning of the market
 Normal working condition
 The unprecedented events
 Closed or broken markets
 Quotation problems
 Null or very few volumes
 Detect the without body candles
 Is my trading strategy becoming obsolete?
 The cycle of a trading strategy
 Automated strategy lifetime
 Relationship between the timeframe and the lifetime
 The obsolescence signs
 The increase in the time in the market
 The increase of the time in latent loss
 The increase in the variance of the return
 The spread increase retest
 The stoploss is too near to a support
 The market dangerously comes near your stoploss
 Backtest summary
 The more probable behavior of a trading system
V. Management of the automated trading systems
 Acceptance tests of the automated trading systems
 The acceptance recipe
 Example of an acceptance recipe
 Acceptance recipe of the overfitting risk management
 The production launching steps
 The validation of the prerequisites
 Validation of the acceptation
 Automated trading preferences
 Details of the trading system
 Risk management
 The putting in production
 Relaunch a backtest
 Send the trading system to ProOrder
 Start the robot
 Confirm the launch
 Activation and verification after production launching
 The validation of the prerequisites
 Opened entry monitoring
 Create a specific interface dedicated to the monitoring
 The ProOrder AutoTrading window
 Opened entries window
 Price charts
 My dedicated interface to the system management interface
 Manually regain an entry
 Why manually regain an entry?
 How to manually regain an opened entry?
 Crash of an automated trading system
 Create a specific interface dedicated to the monitoring
 Manage the technical incidents
 The different types of incidents
 What to do in case of quotation failure?
 Prepare your action plan
 Quotation failure from a marketplace
 Quotation failure of derivatives
 What to do in case of trading safeguards activation?
 Exploding of the spread
 What to do in case of network failure?
 Have a second network connection
 Contact the customer service
 What to do in case of an automated trading system crash?
 Infrastructure monitoring
 IG trading platform status
 Marketplace status
 The continual checking of the trading system efficiency
 The continued test running
 Analysis of opened entries
 Know the not managed and not tested events
 Strategy management using zscore
 Management methods of trading systems
 The series of losses risk
 Description of the decision model
 Calculation and measure of the zscore
 Calculation of the zscore in Excel
 Zscore management rules
 Remind about the zscore interpretation
 Decision threshold to stop a strategy
 Management rules to stop a strategy
 Management rule to stop a strategy
 Management rule to start a new strategy
 Example of the zscore using on a real account
 The limits of the zscore using
Overall conclusions
References and Bibliography
Annex
 Source code to find a trading strategy
 Source code to four technical indicators
 Source code to five technical indicators
 Five moving averages crossings
 Chartist indicator
 Euclidian recognition of the green hammer
 Complete source code of an automated strategy
Secure payment  Installation support  Free updating  Expertise 




11 reviews for Automated trading using Prorealtime – Ebook
Only logged in customers who have purchased this product may leave a review.
Christer Hedman –
Wow! I’ve just read the table of contents… it’s really impressive! It looks like a really good introduction to automated trading. How many hours have you worked on the book?
This looks like an awesome new book about automated trading using Prorealtime from @ArtificallCom. Check out the table of contents. Both scope and depth looks really impressive.
I bought your book now. Looking forward to read it and add some of your knowledge and insights to my own.
Vivien Schmitt –
Hi Christer,
Thank you for purchasing and for your comment 🙂
I spent a complete year writing and translate this ebook. It was tough but a great experience.
Thank you once again 🙂
Traderherz –
Congrats to Vivien from for publishing the english version of his ebook about automated trading!
Good, good work Vivien! Congratulations!!
ProRealAlgos –
Looking to learn more about automated trading with a starting point in the
@ProRealTime trading software?
There are things to learn for both beginners aswell as experienced developers in this ebook.
Written by Vivien @ArtificallCom, a big contributor to the community!
Mattias Hansson –
Just bought it. Looking forward to have a look through it The coming week
RoboFuturesTrdr –
Grabbed a copy and its looking great
Ruark Baker
Peter –
The prorealtime programming guide doesn’t explain in detail how the code works. This book fill in some gaps and has quite a few examples and ideas. It has paid for itself quickly just on use of the ‘QUIT’ instruction alone. I am finding it very helpful.
Olivier T. –
This book is impressive: it combines multiple disciplines such software engineering, math, trading of course…
it is very clear with simple to understand. Congratulations to the author!
Dré à Campo –
This book is a goldmine for developers of automated trading systems, not only for those who are using Pro Real Time. I have been developing automated systems now for a year, and this book gave me the confirmation that I am on the right way. Several of the concepts that I implemented, are also proposed in this book. Furthermore it provided me with many new ideas and improvements for my systems. Especially a lot of attention is given to risk management, backtesting and how to avoid the pitfall of over optimizing your systems (curve fitting). Furthermore the questions I had where promptly answered by the author.
I definitely recommend this book.
Dimitri –
I purchased your ebook “Automated trading using Prorealtime” and I just finished reading it.
First of all, THANK YOU! I really appreciate you putting your time and energy into creating such a valuable resource! I enjoyed reading it and I’ve learned some new things that I will be applying in my own strategy development.
Stephen –
Hi Vivien,
Fantastic! Thank you so much, am really looking forward to reading through the new version. The first one was excellent and helped develop my algo strategies.
Loving your work!
Best
Stephen
Andrew –
Thank you very much Vivien!
I will read it with interest.
See you soon
Andrew