Home Download

Auto Trading

 1 

A. Open Position ( OP )

The Open Position (Main Position) section is the initial part of the transaction. So when all the filters previously discussed are eligible, then this command will be executed. This section consists of:

Order

In this section you will be asked to select the initial order. Options can be Buy, Sell, Buy Pending and Sell Pending

 2 

Pending

If in the order section you choose a pending order, then this section is automatically activated. Here you will be asked to fill in the Range and how long the maximum time order is valid. The range can be filled with positive and negative values. For example, if all filters meet the requirements then a buy order will be placed at 100 points above the current ask position. The opposite can be done with a value of -100 points, a buy position will be realized if the ask position is below 100 points from the current position. While the order validity period is filled with the unit value of minutes. So if the order validity period is 1 hour then it is filled with 60 minutes and so on.

Entri Time

You can limit the time when an Open Position is executed. This constraint can be the day, start time and end time of the day. The time used follows the server time.

 3 

Volume (basic)

There are three options, consisting of:

  • Static

    Static options mean that every initial open position the volume will always have a fixed value

  • %Max

    This option will calculate the maximum volume that can be taken according to your balance, then that value will be converted into a percentage that you enter. So this value can be different for each initial open position

  • Dynamic

    In this option, the volume increases according to the balance rules that we create. There are 2 options available, first the volume will increase if the profit increases according to the input value. Both volumes are determined by dividing the balance against the input value.

 4 

Stop Loss (SL) and Take Profit (TP)

Can be static or dynamic. If you choose static, you will be asked to enter the number in points.

 5 
Static
 6 
Dinamyc
 7 

Candlestick

Here it takes the time frame of the candle that is used as a benchmark, the position of the index bar, and the position of the price of the candle. While the value +/- is additional if needed.

 8 

Trend Price

In this method we will choose the trend ID that was previously created, then estimate the position of the trend value in the future (this has been explained in the previous topic). And also +/- is extra if needed.

 9 

Fibonacci

The third method, using Fibonacci levels as a benchmark. The position can be either above or below the level

Trailing Stop

Unlike the default Trailing Stop on Mt5 that you may already be familiar with. Here have some additional parameters.

Start

There are two types of starting positions here. The first is the price position at the time of the deal order, and the second is the stop loss position. The second position can only be selected if you value the stop loss position.

Step Level

Equivalent to step level on Trailing Stop MT5.

Margin

This is one of the additional parameters used in this software from the standard trailing stop on MT5. Margin is a value addition at the step level that only applies at the beginning. This variable is only available when the start position is determined at the open price position.

Non Profit

The non-profit variable is to limit the maximum stop loss equal to the price of the open position. This facility can only be used if the start position is started from the initial stop loss position.

 10 
 11 

Partial Close

Partial Close is an order to close part of the volume at a certain price position which is calculated in points relative to the price position of the open position.

B. Hedging (HG)

Like the basic understanding of hedging, hedging is a transaction that is intended to anticipate losses that may arise from the main transaction, the main transaction here is the open position described earlier. There are three possibilities that will arise from this method, the first is the existence of losses and hedging has succeeded in eliminating these losses. Second, both the main and hedging transactions suffer losses, so the losses increase. Third, both the main transaction and the hedging transaction all gain profits, so the profit becomes greater.

 12 

In this software, there are five techniques that can be taken to implement hedging. The following is an explanation of the five techniques in question:

B.1. Simple Hedging
 13 

The implementation of hedging using this first method is carried out by following each position opening with the opposite pending order. For example, an open position is a buy, the hedging is a pending sell. The simple logic is that if the price doesn't go up it means the price goes down.

A. Entri Position
 14 

Entry Position is the relative position Hedging placed. There are two options that can be used, namely static and dynamic.

Static

This position is determined based on the distance from the main position. If the position is above the main position then the value is positive, otherwise if the position is below the value is negative.

Dynamic

This position is determined based on candlesticks, trends, Fibonacci as when we use dynamic stop losses on main positions. There are 2 additions, which are determined based on the take profit and stop loss positions.

Expired

Pending time is calculated in minutes

B. Volume

There are two options for determining the Hedging volume

Multiplier

Volume is determined by multiplying the volume of the main position. For example, the main volume is 0.01 lots, so if you want a hedging volume of 0.02 lots, it will be filled with a value of 2.

Target Poin

In this method we determine the target at a certain distance (in points) which allows the hedge to cover the losses from the main position. How much volume of hedging orders will be calculated by the computer itself.

 15 
C. Stop loss and Take Profit (see previous)
E. Trailing Stop (see previous)

The downside of this technique is that if the price reverses direction before the take profit from the hedging is reached, then both the main position and the hedge will suffer losses.

B.2. ZigZag Hedging
 16 

As with the simple method, the zigzag method also takes a position in the opposite direction to the main position. The difference is in the zigzag hedging method, not only once, but positions in the opposite direction are continuously taken until a balance is obtained so that the total transaction is no longer a loss. Of course this technique is accompanied by calculations and controls.

A. Entry Position

Range

The distance from the current price position (ask to enter a buy position and bid to enter a sell position) compared to the last time a position was entered.

Deviation

If we activate the deviation control, then if the distance as mentioned earlier exceeds the deviation value then the command to enter a new position is not executed. This is used to control the occurrence of unnatural price jumps.

 17 
B. Stop Loss and Take Profit
 18 

Range

Stop loss and take profit distance unit value

Fixed

Control to equalize all stop loss and take profit values are the same even though the entry is slightly different.

C. Volume
 19 

Previously discussed about volume in the simple method. In this section there are some additions :

Liability Only

Will only be active on the target point type. If the open position is more than 1, then one of them in the target position is definitely a profit, that way we can choose whether the target calculation will also include the profit value in the calculation, or only calculate the losing position.

Counter

This will only be active if the volume type is a multiplier. The calculation basis consists of two options, namely the volume of the main position or the volume of the last position. If you choose the volume of the main position then there are 3 more options, first : fixed, second : calculation is continued by multiplying the number of open positions and third : the calculation is continued by multiplying according to the index of open positions.

Power

When there is a repetition of up and down prices then at some point the price will actually go up or down. So when that happens, to get a bigger profit, the power volume can be increased. Your task during the testing process is to detect exactly how often it occurs. If the value is found, enter it as input n and the volume multiplier can be inputted into the multipler section.Power can be calculated based on the number of open positions, or according to the last index of open positions. It may look no different, but if you use an emergency count (which will be explained in the next section) the difference will be noticeable.

Maximum Volume

This control serves to limit the maximum volume allowed, because the calculation results can produce very large volumes.

D. Position Count
 20 
  • Maximum Count

    Limit the number of open positions, if the number is equal to this value then the next position is not opened again.

  • Emergency Count

    It also limits the number of open positions, the difference is that in this method new positions will still be opened but the earliest positions will be closed.What needs to be considered here is not to give a value greater than the "Maximum Count"

E. Close Method
 21 
  • Trailing Stop

    This method will close all open positions that are opposite to the "Trailing" position. Previously, we discussed margin on the trailing stop, now this is where the importance of margin is because with the existence of margin, the first time the trailing is executed, it can be ascertained that the profit has been achieved, the next process is just waiting for additional profit.

  • Profit/Loss

    Unlike the way to close using a trailing stop, this method calculates the value of the ratio between profit and loss. If the comparison value has been met according to our input value, then all positions will be closed.

#. Trailing Stop
 22 

Previously we have discussed about "Trailing Stop". The same thing applies here, except there is a new addition that is a plus. As explained that this hedging method consists of several positions, when a position is opened, each position has been assigned an index. Besides the index, the number of positions is also recorded automatically, now the actual number and index are also separate indicators, large numbers and indexes indicate that open positions are repeated so often, when that happens it may be time for us to reduce our profit target, therefore a plus is needed here. , plus here does not mean having to increase the margin or step level, but it can also mean a reduction. The trick is to give a negative value. This of course applies to the closing method using a Trailing Stop.

#. More Hedging
 23 

We can combine two or more hedging methods on one algo unit. The combination can be the same hedging method, or it can be different. Maybe this can call it "Hedging to Hedging". We will discuss when discussing Hedging Followers.

The weakness of this method is that if the sideway condition occurs for a long time, it is possible that a margin call may occur.


B.3. Followers Hedging
 24 

This method can't actually be categorized as hedging, but in its application it uses a lot of hedging techniques, so we still include this method.

A. Entry Position
 25 

Range. The distance between the next open position and the previous open position, filled in points

Deviation. The maximum value of the deviation of the specified distance of the two open positions, to be filled in units of points.

Expand. Widening or narrowing a predetermined distance. Filled with percentage units.

  • First : The distance calculation uses the distance between the main position and the second position.
    Last : Distance calculation uses the distance between the last position and the previous position.
  • Starting Points : Expand application begins.
  • Count : By Number of open positions
    Index : According to the index of open positions

Minimum Range. If in the calculation later obtained a range value that is smaller than this, then the value used is this minimum value.

Maximum Range. If in the calculation later a range value is obtained which is greater than this, then the value used is this maximum value.

B. Stop Loss and Take Profit (see previous)
C. Volume (see previous)
D. Close Method
 26 

Close by percentage

Method :

  • Close All. All open positions will be closed
  • Close one by one. Profit positions will be closed by one on one losing positions

Loss/Profit : Comparison between position loss and position profit

Maximum Count : Maximum number of open positions

#. Trailing Stop (see previous)
#. More Hedging

When discussing zigzag method, we have postponed this discussion, so now we will give an example of how to use the Hedging to Hedging technique. We will use the followers method and the zigzag method as examples.

 27 

As you can see in the picture above, we will open the first position ( Buy ) symbolized by A, with 2 plans to deal with possible future price trends. The first plan ( plan A ) is if the price goes up, then we will open another buy position ( symbolized by 1,2 and 3) with the distance of each new open position is 100 points. With a profit-taking plan on TP (F) at a distance of 400 points from the main position. On the other hand, if there is a price decline, we have prepared a second plan (plan B). With the aim of taking profit at the TP(Z1) point, but if it turns out that before the Z1 point is reached and the price reverses, the profit will be at the Z2 point. The first plan is the FOLLOWERS type and the second plan is the ZIGZAG type.

We will make the algorithm command as follows:

Plan A ( Create Followers Hedging )

1. Create a new document

2. Go straight to the Auto Trading tab, because in this case we don't use filters at all

3. Check Open Position ( OP ) and select the order position "Buy ( Market )"

4. Entri Time : Just leave the default values

5. Volume is filled with the lowest value which is 0.01 lot

6. We don't use stop loss because we have a plan to use ZigZag hedging for anticipation ( plan B ).

7. Take Profit : Filled with 400 points according to the plan.

8. Trailing Stop and Partial Close are unchecked, because they are not included in the plan.

9. Check Hedging (HG) then select Followers

10. In the entry position section, Fill in the range with a value of 100 points. New position will be opened in the range of 100 points from the previous position.

11. We will equate the take profit of the main position and the next position, of course the value is 100 points different because the distance has been reduced by 100 points. Then tick Fixed because the next position will also be the same.

12. The volume is equal to the volume of the main position, so use a multiplier of 1.

13. In this section we do not need to activate the closing method because we are using a take profit closing technique. Although both can be used simultaneously. What needs to be filled in is the maximum number of followers. fill in the Maximum Count as much as 3 according to the plan.

14. Trailing Stop does not need to be activated, as explained in section 13 we use take profit.

15. More Hedging. Activate ZigZag hedging and click the button, In this section we will enter into plan B

Plan B ( Create ZigZag Hedging )

 28 
1.Fill with a value of 100 points.
2.Choose First, because we are using the main position as the starting position of the measurement.
3.Check below, because the position is under the main position.
4.Fill with a value of 100 points. For the next ZigZag position distance.
5.Select Target Point for ZigZag initial volume.
6.Check Liability Only. This is the default value, the point is to calculate the Target Point volume without including profit in the calculation.
7.Fill in the target point value of 200, according to the plan.
8.Subsequent ZigZag volumes also use Target Points, as planned. There is no need to check Liability Only so that followers' profits are included in the calculation.
9.Fill in the number 200 points according to the plan.
10.Use a Trailing Stop as a method to close.
11.Activate Trailing Stop
12.Fill in the Step Level value of 25 points, so that later if the price continues to fall or continue to rise, excess profit will be obtained.
13.Fill Margin Level of 225 points, normally equal to Target Points. However, because this is a ZigZag, where prices are in different directions, the ASK, BID and step levels need to be taken into account so that the end result is not a loss.
 29 

The actual graph of the previous planning model graph. To find out which plans are realized.

The test results can be seen in the image below. The test results on the last month's data from 2022-06-01 to 2022-06-04 when this document was created.

 30 
 31 

Of course this is just an example and it is not recommended to use it. Apart from not using a filter so that it may not be suitable for every situation, the range of data used during testing is very less.

B.4. Martingale Hedging

 32 

This method is widely known by traders. The rationale of this technique is however the uptrend or downtrend will definitely end and will reverse direction. As in the ZigZag method both rely on the power of capital to ensure profits, both are often successful, but also carry a very large risk. So it is highly recommended to be careful using these two methods. Make sure you use the available controls and test as often as possible with a sufficient range of data. It should be noted that all of the methods discussed in this section and earlier, are attempts to salvage a losing transaction. So our focus is on the initial transaction, make sure this transaction is feasible and even if losses can arise then that's where you think about how to eliminate these losses with the hedging method that we have discussed.

Some parts of this method are the same as the previous method, so only different parts will be explained later.

  • A. Entry Position (see previous)
  • B. Stop Loss and Take Profit (see previous)
  • C. Volume (see previous)
  • D. Hedging Count (see previous)
  • E. Close Method

     33 
    • Target Profit/Loss

      This method will calculate the ratio as a percentage between profit and loss, if the results match the input, the entire position will be closed.

    • Trailing Cutter

      This technique uses a trailing stop as the basis for closing a position. The number of closed positions is calculated from the round result of the division of the amount of profit that can be ascertained by the input provided and is calculated in points. Closed positions can be started from the initial position (lowest index) or started from the last position (highest index). Please note that closed positions are positions for which there is no certainty of profit (the trailing stop position has not been executed), while positions whose profits have been confirmed will not be closed.

    Safety Cutter

    In addition to using the trailing cutter, we can also use the safety cutter technique with a slight difference in the calculation technique. In this technique what is calculated is the profit and loss ratio, if a profit position is found it will look for a loss position and then both are compared with the input ratio, if they meet the requirements then the two positions will close each other.

    • Safety (profit/loss): Filled with the required ratio

    • Step Over: Ignore some nearby positions.

    • Including non loss: Keep closing all positions regardless of profit or loss.

    • Op Immunity: The prime position will be the first target. (If this is not activated then the main position will always be held until the position makes a profit)

    • Safety Point: This method is almost the same as the trailing stop, where the deviation is the same as the step level. The difference lies in the calculation of the number of positions to be closed, in this technique the calculation will focus on the profit and loss ratio.

    All of the above methods can be run simultaneously, but you should choose only one, because in addition to burdening the computer with a long calculation process, logically the three methods have the same goal, only technically different.

  • #. Trailing Stop (see previous)
  • #. More Hedging (see previous)
B.5. Position List Hedging

Unlike ZigZag, Followers and Martingale hedging, entry positions are determined through a calculation process and the type of position (buy or sell) is also set by the computer. In this hedging method, you are given the freedom to determine each entry position based on the distance relative to the main position, also the type of position (buy or sell) you have to determine yourself.

 34 
  • (1). This section is a brief information on each position. If you click on one of the positions on the right (2), the information for that position will appear in this section.
  • (2). This is a list of the positions you entered. To add or edit the list of input positions use the Add button. Meanwhile, to delete the entire input position, click the Clear button.
  • (3). Close All (profit/loss): If this is enabled then when the ratio of the profit position to the loss position meets the requirements as input, then all open positions will be closed, and a new process will start again.
    • Only if orders are Composite: The order will only be executed if there is a buy position and a sell position
    • Profit/Loss: This is the ratio value which is a condition for the order to close all open positions.
  • (4). Close All Opponents When OP Groups Epmty: This command will be executed if all positions of the same type as the main position (OP) no longer exist, then all different positions will be closed. For example, if the main position (OP) is long, then when the long position is no longer there, all remaining positions, namely short positions, will be closed.
 35 
  • Position Group

    this is a choice of positions to be opened whether to buy or sell. Please note that all open positions will be grouped into two groups, namely the buy group and the sell group.

  • Range (poin)

    The relative distance of the open position to the main position, if the position is below the main position then the value is negative. Distance is calculated in points

  • Deviation (poin)

    Maximum deviation value allowed (calculated in points). This value is useful for avoiding unwanted positions due to price jumps.

  • Volume

    As in the previous discussion, there are 2 types of volume, namely multiplier and target points. In this section, because we will determine the multiplier type ourselves, the multiplier type is replaced with a Static type, while to obtain the volume from the calculation results we use target points but the name is changed to Dynamic type. There are three options for obtaining volume calculation results:

    • Groups : Volume is calculated using target points by calculating only based on positions that are in the same group as the position to be opened.
    • Opponents : Volume is calculated using target points by calculating only based on positions that are different from the group to be opened.
    • Composite : Volume is calculated using the target points of the entire position.

    As for the Liability Only section, it was previously explained.

  • Stop Loss and Take Profit (calculated in points)
  • Trailing Stop

    The trailing stop here is the same as the trailing stop used before. For Trailing Cutter, the explanation can be seen again in the Martingale section, in this section there are 3 additional parameters that are different from the previous one:

    • Price : Cutter will work on the input price filter from this position.
    • Index : Cutter will work in order of position index, can be started from the lowest index to the highest index or vice versa.
    • Groups : The cutter will work according to the input group.
    • Deviation : The difference in the farthest value allowed from this position and the position to be closed, so that the two values are considered equal.
  • Non Recurring

    If this command is activated then this position will not be opened again until the process is started from the beginning again.

  • Safety

    In addition to this position then positions with different groups will be opened with volume calculated based on a percentage of the volume of this position.

  • Dependency
     36 

    This is the rule of dependence of this position on another position. To set click the f(x) button. After that, the form field will appear as picture.

    If the position in the list is checked then this position depends on the position, if the Existing section is checked then this position will only be opened if the position is still there, otherwise if it is not checked then this position will only be opened if the position does not exist.

C. System and Risk Control

C.1. System

System settings consist of:

 37 

Type Entry OP

This section will set how the main position is initiated. For example, when the entire series of Algorithmic transactions has been completed, the opening of the next major position is allowed using a timer or using a time frame. Here's the explanation:

  • Period (Time Frame) : If we use this option, the calculation of the main position opening follows a change in the period or "Default Time Frame". So if the main position has been opened and we input 3 with "Default Time Frame" M1 then the main position will be opened again after 3 minutes (3x1 minutes) or 3 Bar Time Frame M1.
  • Minutes : This option will use a timer in minutes. So if the main position starts at 12:00 and we input 30 minutes, then the main position can start again after 12:30.
  • Run Only Once : This option will execute one Algo Trading unit only once..
  • Maximum Spread

    This tool will control the opening of new positions not to be executed when the spread ( ASK and BID distance ) exceeds the maximum value.

  • Deviation Order

    This will control the position opening from being executed when the price crosses this divergence. For example, if you give a deviation of 10, then after all the filters have been checked and all allow to open long positions at the price of ASK 1.07146, but due to network problems or the price is no longer available, then the long positions will only be executed when the ASK value does not exceed the value. given deviation. In this case the maximum ASK value allowed is 1.07156 and the minimum is 1.07136.

  • Commision/Lot

    The actual commission calculation has been calculated by the software, but in some cases that I found at certain brokers this value does not appear. It's not that the broker doesn't use commission, but on mt5 that value doesn't show up. to avoid calculating the commission not coming in, then this value must be filled in. If later the value is already available in mt5, the software will automatically refer to that value.

    Round : This tool is a rounding order on commissions for certain cases. For example, when a broker uses 7$/lot, in a matter of 0.01 lots it should only be 0.07$ but in fact it is not, the value is rounded up to 0.08$. In order for the value to match then this tool must be activated.

C.2. Risk Control

This section will control the overall risk of one Algo Trading unit. Consist of :

 38 

Close All Transactions

This control will close all transactions on one Algo Trading unit. Consists of three options:

  • Daily : This option will close all daily transactions at 23:59:59.
  • Weekend : This option will close all transactions every Friday at 23:59:59.
  • Time : This option will close all daily transactions at the specified hour.
 39 

Maximum Loss

This control limits the maximum loss allowed by one Algo Trading unit. If this occurs, all positions held by the Algo unit will be closed.

  • Type

    Static : This option will use the value of money as the maximum loss limit. For example, the maximum loss is $250.00

    Dinamyc : This option uses a percentage of the balance value held when one Algo Trading unit is started.

  • Apply

    Stop Trading : This option will stop Algo Trading units from being terminated, if the maximum loss conditions are met.

    Use Minimum Volume : This option will still give the Algo unit a chance, but the main position will use the smallest Volume.

    Continu : The work of the Algo Trading Unit will continue.