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:
In this section you will be asked to select the initial order. Options can be Buy, Sell, Buy Pending and Sell 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.
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.
There are three options, consisting of:
Static options mean that every initial open position the volume will always have a fixed value
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
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.
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.
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.
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.
The third method, using Fibonacci levels as a benchmark. The position can be either above or below the level
Unlike the default Trailing Stop on Mt5 that you may already be familiar with. Here have some additional parameters.
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.
Equivalent to step level on Trailing Stop MT5.
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.
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.
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.
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.
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:
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.
Entry Position is the relative position Hedging placed. There are two options that can be used, namely static and dynamic.
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.
This position is determined based on candlesticks, trends, Fibonacci as when we use dynamic stop losses on main positions. There are only 2 additions, which are determined based on the take profit and stop loss positions.
Pending time is calculated in minutes
There are two options for determining the Hedging volume
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.
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.
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.
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.
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.
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.
Stop loss and take profit distance unit value
Control to equalize all stop loss and take profit values are the same even though the entry is slightly different.
Previously discussed about volume in the simple method. In this section there are some additions :
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.
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.
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.
This control serves to limit the maximum volume allowed, because the calculation results can produce very large volumes.
Limit the number of open positions, if the number is equal to this value then the next position is not opened again.
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"
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.
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.
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.
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.
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.
The following explains some of the parts in this method:
The distance between the next open position and the previous open position, filled in points
The maximum value of the deviation of the specified distance of the two open positions, to be filled in units of points.
Widening or narrowing a predetermined distance. Filled with percentage units.
If in the calculation later obtained a range value that is smaller than this, then the value used is this minimum value.
If in the calculation later a range value is obtained which is greater than this, then the value used is this maximum value.
All open positions will be closed
Profit positions will be closed by one on one losing positions
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.
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:
Create a new document
Go straight to the Auto Trading tab, because in this case we don't use filters at all
Check Open Position ( OP ) and select the order position "Buy ( Market )"
Entri Time : Just leave the default values
Volume is filled with the lowest value which is 0.01 lot
We don't use stop loss because we have a plan to use ZigZag hedging for anticipation ( plan B ).
Take Profit : Filled with 400 points according to the plan.
Trailing Stop and Partial Close are unchecked, because they are not included in the plan.
Check Hedging (HG) then select Followers
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.
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.
The volume is equal to the volume of the main position, so use a multiplier of 1.
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.
Trailing Stop does not need to be activated, as explained in section 13 we use take profit.
More Hedging. Activate ZigZag hedging and click the button, In this section we will enter into plan B
|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.|
Before we look at computer-generated test results, let's take a look at the actual graph of the previous planning model graph. To find out which plans are realized.
The following are the test results on the last month's data from 2022-06-01 to 2022-06-04 when this document was created.
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.
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.
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.
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.
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.
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.
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.
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
Maximum deviation value allowed (calculated in points). This value is useful for avoiding unwanted positions due to price jumps.
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:
As for the Liability Only section, it was previously explained.
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:
If this command is activated then this position will not be opened again until the process is started from the beginning again.
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.
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.
System settings consist of:
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:
This tool will control the opening of new positions not to be executed when the spread ( ASK and BID distance ) exceeds the maximum value.
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.
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.
This section will control the overall risk of one Algo Trading unit. Consist of :
This control will close all transactions on one Algo Trading unit. Consists of three options:
This option will close all daily transactions at 23:59:59.
This option will close all transactions every Friday at 23:59:59.
This option will close all daily transactions at the specified hour.
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.
This option will use the value of money as the maximum loss limit. For example, the maximum loss is $250.00
This option uses a percentage of the balance value held when one Algo Trading unit is started.
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.
The work of the Algo Trading Unit will continue.