Writing an article on "How to write a TOR for a trading robot" - page 4

 
 

Standards and templates for TOR for software development

https://habrahabr.ru/post/328822/

Стандарты и шаблоны для ТЗ на разработку ПО
Стандарты и шаблоны для ТЗ на разработку ПО
  • 2017.05.17
  • habrahabr.ru
Недавно ко мне обратились, чтобы я посоветовал стандарты для написания технического задания (ТЗ) на разработку автоматизированных систем (АС) и программного обеспечения (ПО). Вот думаю, сейчас зайду в Яндекс, найду подходящую статейку и отправлю её. Но не тут-то было! Одной статьи, где перечисляются стандарты для ТЗ, включая шаблоны и примеры...
 
Rashid Umarov:

A brief outline of an article on the advisor's TOR.

Introduction. The article is written only for the customer, "a dilettante", given his extremely low level of understanding of the subject. Often, the customers do not even know what an Expert Advisor, an indicator or a terminal can do. This does not mean that we have to "sink" to the level of the customer. You just need to explain everything in a humane way (without the abstruse programming language).

Terminology. A minimum of sufficient terminology. Literally at a level where (if for MT4) the orders are opened and closed, and the pending orders are set and deleted. Glad for the necessary explanations, like what overframing is and how it is detected. Examples of non re-routes: fractal, zig-zag. <...>

2. Classification of functionality of Expert Advisors with explanations for each point. Indicator and nonindicator Expert Advisors. Ways of signal processing: inside bar and on close. Support options: Trawl, Breakeven, Averaging. Money Management: Variants. <...>

Questionnaire of the future Expert Advisor's functionality. The result of the questionnaire is an approximate idea of the necessary functionality. For each functionality you can set the complexity factor. Which will allow you to orient the customer to the cost of development.

4. Testing of the completed solution. Here we explain how to test the Expert Advisor for the bugs and broken functionality. How to explain the detected bugs and bugs.

Conclusion. Recommendations.

p.s. At least 80% of the orders are typical and their functionality is within the known classification scheme.

p.s.2 Many points are clearly explained in two articles of the Composter. It is possible to cross-reference, to borrow and to clarify.

 
Rashid Umarov:

While I want to understand what types of EAs are ordered, which ones can be categorised

  • Martingale
  • Anti-Martingale
  • Grid
  • Multicurrency
  • Scalper
  • etc.

What are the options in Freelance?

A number of points have been written to you in person. Now I'll just put them into public discussion.


This classification is the most common, but it doesn't reflect the functionality used in the Expert Advisor.

For example, the "grid" may be a simple grid, it may be a martin, or it may be a lan - the determining factor here is "how the lot is calculated".

Therefore, we need to classify by the functionality to be used - then the structure and complexity of the Expert Advisor will be clear - and that's what we need for developing the ToR.

Classification is the hardest part -- I'll give you some rough idea, but if you need more details, you'll have to put a lot of thought into it:

1. By type of opening signal:
-- indicating
-- non indicating

2. By type of close signal:
-- simple (take, stop, reverse open signal)
-- indicator
-- total stop/stop (averaging)
-- by result (profit/loss)

3. By lot calculation method (you may call it "money management", but it's not quite correct):
-- simple
-- percentage of balance
-- "martingale" type (when lot is increased by coefficient)
-- "ilan" type (when lot is calculated by price target)

4. Open position/orders accompaniment :
-- grid (when one order is followed by a grid of orders)
-- locking
-- averaging
-- trailing stop
-- no-loss

5. Multicurrency (there is a different understanding of multicurrency)

....

-- then you have to think and much, very much is not unambiguous -- i.e. you have to literally "sketch out" what is and what has been encountered and classify it.


But classification is quite a complicated affair -- there is also classification of entries by signal to open -- by type of signal identification (on a closed bar, inside a bar).

The only thing I would like to point out is that classifications like "martingale", "scalping", etc. are practically meaningless. We need more detail.

By the way, if you make a complete classification - then you can make something like "advisor menu" - like, "birds" put and the TOR is ready.

 
Rashid Umarov:

New iteration of the article plan

Types of Expert Advisors

Signal - based on indicator signals

Multi-order - all sorts of grids

Semi-handheld - reaction on traders' actions (objects, intercepting keystrokes, catching an order opened manually)

Auxiliary - draw, send, work with charts and quotes, etc.

Downlinkers - to download some information from the website

Copyers - copy trades and other terminal interaction

Account type for MetaTrader 5


Signal and Multi-Order -- Indicator Expert Advisor (as it is usually called) allows you to open multiple orders in one direction and then work with these multiple orders as a grid. In fact, when they say "grid", they mean to open orders with a step of each other (something like "we stretch the grid of orders").

It means that a grid has a very relative difference from a "not a grid" and this difference lies at the level of "conditions of opening" where the orders may be opened by indicator signals or put out by pending orders with the distance or something else.

Semi-manual and further accompaniment - this is an indicator EA that simply does not have an opening block, but only an accompaniment block.

"Martingale/Antimartingale" - this is the same functionality, which differs in the calculation of the lot based on the last opening or, more often, closing.

 

lot calculation system (I think full, no other options have been encountered as a matter of principle):

-1- fixed

-2- in % of balance (Equity, not important, rarely used)

-3 - based on the results of the previous opening/closing (the last order was opened or closed, the point is that the lot depends on the order lot in front of it - here, the lot of one or several orders can also be taken into consideration)

-4 - from the move target (stop loss or take profit value is not the point, the important thing is the distance in pips)


p.2. % of balance - two methods of calculation: a) taking into consideration the percentage of deposit loss and b) in proportion to the deposit size.

% of the balance is a pure %, and sometimes it is calculated taking into consideration the stop loss (it is clause 4)

i.3. if based on the close results, this is a single order - if based on the open results, a grid of orders is created.

martingale as a doubling of the lot size is a special case here - there is a roulette system that describes all the possible conditions that may occur.

There are two options here: a) % risk with respect to the size of the stop and b) from the take profit target (this is the "ilan" scheme, when you build a grid of orders).


averaging is not part of the lot calculation - averaging is a way to calculate take profit and stop loss.

 

Grids can be unidirectional or bidirectional.

The one-way ones are when each direction (buy and sell) is independent.

The only functional link between all the grids is the averaging, which is a price level at which the grid closes.

The averaging may be either by Take (close against a movement) or Stop (close against a movement).

as a rule, the take is fixed.

a stop loss can be dynamic (for example, break-even or trailing).


in mt5 the task of averaging is solved by netting - therefore in mt5 (netting) working with grids has its own characteristics, unlike in mt5 (hedging).

These peculiarities appear only when evaluating shares (opening a grid level) and when working not through an aggregate position (in a grid, each order may behave independently).

 

functionally:

-- opening block (by indicator signal, by results of previous opening/closing, usually a step)

- block of lot calculation (money management, but money management is not limited to calculation of lot)

- block for calculating the initial stop (fixed and dynamic)

-- Initial takeoff calculation block (fixed and dynamic)

- block of maintenance - there are different maintenance: a) shares, b) stop maintenance (break-even, trailing, of course, fixed and dynamic), c) takeout maintenance (averaging), d) lot maintenance (partial closing, adding, short)

-- block of closing (as a rule, it is closing according to indicator signals, closing on profit -- closing through take/stop has its own classification)

-- block of trade restrictions (restriction by time, by other factors)

-- information block (info panels)

what applies to Expert Advisors, copying -- these, of course, can be presented as independent, but they can be prescribed in the above-described functionality.

 

If we are talking about the signal processing at the bar opening and inside the bar, then we need to emphasise:

-- Understanding of the "bar opening", because there can be shifts, for example an entry in 10 seconds before the close of the bar, not a simple case of taking the signals off the indicators

-- The signal confirmation block, because at the opening of the bar the signal is confirmed by the bar closing, but inside the bar the signal may "stray" and we should do something with it.

 

market entry and pending entry are different:

-- understanding of entry point stability (the market entry point is unknown -- a pending entry point is known) -- sometimes pending entry is replaced by market entry, but in this case we have to constantly check for level crossing in the Expert Advisor

-- the necessity of the matching block (for pending entry) -- this block allows to close the buy order when a sell-slip goes through -- in mt5 this problem is passed to the block of lot calculation, thus eliminating the matching function