BreakingTrend
- エキスパート
- Iurii Kuksov
- バージョン: 1.0
- アクティベーション: 5
The Breaking Trend ADVISOR opens the first position only to buy an order. Next, he looks at if the price goes to a loss, then at a certain loss distance he puts a pending Stop Order Sell for sale with an increased lot in order to cover the loss and fix the profit when closing buy and sell orders. And then the whole trade actually takes place with this logic.
These are the settings of the advisor:
-- LOT --- extern double lots = 0.2; - this parameter is responsible for the purchase of a lot when opening the first position, purchase orders. extern double MultiplyingLotForFirstTime = 3.0; - this parameter answers by which number it will be increased (multiplied), the initial purchase lot to open a pending order for sale, in order to pay off losses on an open purchase order and when a certain profit is reached, close all orders (for purchase and sale), which are on the market and participating in the auction. In a way, this is the strategy of this adviser: To open orders only for purchase, and by placing pending orders for sale, where the trader usually puts his stop loss and if the price goes to a loss from the first open order, then the trader has the opportunity to make money on this loss. In theory, this OrderCloseBy function is available in the mql4 language, but not all brokers allow it to be used in trading. Here the lot is multiplied by 3.0 and will be equal to 0.6 lots when buying a pending stop order for sale, and TheFirstOrderToClose parameter will show which one at a distance from the first open buy order, a pending sell order will be opened if the current price crosses this barrier set by you, in which you set this distance allowing your losses. The pending sell order itself will be opened plus 50 points from the distance you specified in this parameter. extern double IncreasingLotForSecondTime = 4.0; - this parameter answers by which number the current one will be increased lot (0.6) and will already be equal to 2.4 lots with an open pending order for sale and if, suddenly, the current price changes again the direction of the trend will begin to make a loss already on the open a sell order, but with all this, she will compensate for her if there is a loss with the first open buy order, then we will try open a pending stop order to buy so that when a certain profit is reached, which is specified in the closelotprofit parameter, all orders in our market would be closed and we would start our tactics anew. It should be noted here that the closelotprofit parameter works from the specified parameter and can be greater, but not less than the specified parameter. The pending stop order for purchase will be opened at the specified distance by the TheSecondOrderToClose parameter,when the current price is reached, a pending stop order for a purchase of 500 points from the current price will be opened and it will be designed for a sudden market fluctuation in the growth of purchase prices in order to open and immediately close all orders in our market in order to start your trading strategy anew. The TheSecondOrderToClose distance is indicated from an open pending sell order plus 500 points. extern double IncreasingLotForThirdTime = 3.0; - well, if everything goes wrong here, and everything doesn't go our way, then this parameter will be responsible for increasing the current lot for sale and which we will try to open at a distance from the very first us an open position to buy and, the lot will already be equal to 7.2 lots for sale. P.S: Here it is necessary to notice one feature that the deferred orders can be placed in a large lot, but this is not the fact that they will be opened in the market. extern double IncreasingLotForFourthTime = 5.0; - well, this parameter can already be said to be a lifeline for the adviser and which will increase the current lot by the specified number and it will be equal to 36.0 lots for opening a purchase order. And this one the parameter interacts with The Fourth Order To Close parameter which indicates the distance from the first open order It is designed to open a closing buy order and close all orders and at the same time change the trend for further trading, so that you can start all over again. --- ORDER OPENING DISTANCE --- extern int TheFirstOrderToClose = 100; - this parameter is responsible for the distance to open a stop order for sale plus 50 points from the first open buy order. extern int TheSecondOrderToClose = 150; - this parameter is responsible for opening a pending stop order to buy plus 500 points from an already open sell stop order. extern int TheThirdOrderToClose = 200; - This parameter is used to open a sell order and is calculated the distance from the first open purchase order and located in the market. extern int TheFourthOrderToClose = 5800; - this parameter is responsible for opening the last order of the ADVISER, upon reaching which a purchase order will be opened in order to close all orders that are in the market and change the trend to start trading the operations are repeated. --- CLOSE --- extern double closelotprofit = 0.01; - this parameter is responsible for the profit at which all orders will be closed located in the market and opened by this adviser. P.S: it should be noted here such a feature that when the price fluctuates, orders will be closed more the specified parameter, but not less. That is, if you specify 10.0, then, for now the amount of orders opened in the market will not be equal to 10.0 orders will not be closed. But if the amount of orders is equal to the fluctuation of the market price: 10.01, 11.0, 12.0, 13.0 20.0, etc. then the orders will be closed. That is, the parameter indicates that orders will be closed at least this parameter. That is, if the amount of orders is 9.99, then the orders will not be closed. -- TREND LINE --- enum TREND - these are enumerations of parameters that indicate the period for which the trend will be calculated. { Period_M1 = PERIOD_M1, Period_M5 = PERIOD_M5, Period_M15 = PERIOD_M15, Period_M30 = PERIOD_M30, Period_H1 = PERIOD_H1, Period_H4 = PERIOD_H4, Period_D1 = PERIOD_D1, Period_W1 = PERIOD_W1, Period_MN1 = PERIOD_MN1 }; input TREND trendline; - in this parameter, you will just specify for which period you will calculate the trend for the adviser to work and open the first order. extern int Last = 1; - this parameter indicates the minimum price of the bar. The last bar is listed here and its the minimum price. If you set 0 to zero, then the calculation will take place at the current price. extern int First = 20; - this parameter indicates the minimum price of the bar. The twentieth bar is listed here and its the minimum price. If you set 0 to zero, then the calculation will take place at the current price. PS: Here it should be noted that the adviser begins to work on a downward trend. But it can be done that he will also start trading on an uptrend. How? Swap the values. Where there is a unit, put twenty, and where there is twenty, put one. --- MAGIC NUMBER --- extern int magic1 = 111; - this is the magic number of the first order. extern int magic2 = 123; - this is the magic number of the second order. extern int magic3 = 124; - this is the magic number of the third order. extern int magic4 = 125; - this is the magic number of the fourth order.