거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
게시자:
Vladimir Karputov
조회수:
4500
평가:
(12)
게시됨:
2018.06.18 10:22
Lock.mq5 (28.41 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Idea by: Igor.

MQL5 code by: Vladimir Karputov.

Suppose a trader enters the market with the Buy and Sell positions by an asset, where the currency is, say, at the level of 100. Then the prices moves to 200. Here, buying for 100 will be profitable, and selling for the same will be losing. We close our buy position, and the profit of 100 comes to our account. In this case, selling results in losing 100 units.

When using a grid, you should be sure of being able to make profit whatever direction is taken by the market. For this purpose, enter your Buy and Sell transactions again. Now, for the sake of convenience, let us assume that the price is moving to level 100 again.

The repeated selling will lead to +100, while the second buying will result in -100. According to the rules, you can close your sell position, and 100 more units will enter to your account. As a result, at this point, we have the total profit of 200.

Now, the first sell position that has remained active is moving from level 200 to level 100. It is in the breakeven range now.

Summing up the four transactions, we get the profits as follows: +100 for the first Buy; +100 for the second Sell; 0 for the first Sell, and -100 for the second Buy. The total profit has made +100. So we can delete all the orders and drink a glass of champagne. Prior to each subsequent double opening (simultaneous opening of Buy and Sell), we increase the lot size by the factor of Lot exponential.

There are many other market movements that make profitable these seemingly incomprehensible activities of simultaneous buying and selling.

However, in such trading, there is always a risk of "hanging" positions, i.e., positions that produce relatively high losses and have an opening price that is located very far from the current price. To overcome such "hanging" positions, we have introduced two parameters: Excess of balance over Equity (balance exceeding the Equity) and Mimimum profit.

In all cases, be careful, since two scenarios are possible: Optimistic

Lock Optimistic

and pessimistic

Lock is pessimistic


Input parameters

  • Lots - initial lot;
  • Take Profit - Take Profit;
  • Lot exponential - lot increase ratio;
  • Excess of balance over Equity - balance exceeding the Equity;
  • Mimimum profit - minimum profit;
  • magic number - unique identifier for the EA.

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/20781

AIS2 Trading Robot AIS2 Trading Robot

An automated trading system with a data panel in form of the OBJ_LABEL objects.

ADX_Cross_Hull_Style_NRTR ADX_Cross_Hull_Style_NRTR

An NRTR-type indicator using Average Directional Movement Index.

ADX_Cross_Hull_Style_NRTR_HTF ADX_Cross_Hull_Style_NRTR_HTF

Indicator ADX_Cross_Hull_Style_NRTR with the timeframe selection option available in input parameters.

InvertCandle InvertCandle

The inverted chart of the current financial instrument.