거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Hidden StopLoss and TakeProfit System - MetaTrader 4용 라이브러리

조회수:
14781
평가:
(11)
게시됨:
2017.09.22 08:51
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The attached files represent a class system that can be used to simulate a hidden Stop Loss and Take Profit system, however in addition to this, it also creates a live Stop Loss and Take Profit on the trade just in case the connection between the client and broker server goes down. There are also 4 example EAs. A basic description of how the system works is as follows:

  1. A class object is created with the trade characteristics that are required.
  2. A set of functions that are very similar to the OrderSend, OrderModify and OrderClose functions have been provided in the class for opening the trade.
  3. The class records the hidden Stop Loss and hidden Take Profit.
  4. When a trade is opened, a real Stop Loss and Take Profit is added onto the trade that is bigger than the hidden Stop Loss or Take Profit.
    • Buy: Minimum Stop Loss 1 = hidden Stop Loss - Live Spread.
    • Buy: Minimum Stop Loss 2 = Current Spot - {Freeze Level/Stop Level Adjustment} - Live Spread.
    • Buy: Actual Live Stop Loss is Min (Stop Loss 1, Stop Loss 2).
    • Sell: Minimum Stop Loss 1 = hidden Stop Loss + Live Spread.
    • Sell: Minimum Stop Loss 2 = Current Spot + {Freeze Level/Stop Level Adjustment} + Live Spread.
    • Sell: Actual Live Stop Loss is Max (Stop Loss 1, Stop Loss 2).
  5. The idea was to choose a level for Live Spread that will be large enough to cover any changes in the spread for Stop Loss hunting, but also any changes in the Stop Level and Freeze Level that may occur.
  6. I would suggest recording the spread, Stop Level and Freeze Level over a week and recording the difference between the minimum and maximum of these values. The Live Spread should be set so that it is greater than these differences.

To get the system to work please use the following procedure:

  1. Add GlobalChartFunctions, C_Trade, C_Trade_TrailingStop Loss, C_Trade_SteppedStop Loss, C_Trade_Pending into the include directory.
  2. Add C_Trade_BasicExample_1, C_Trade_TrailingStop Loss_2, C_Trade_SteppedStop Loss_3, C_Trade_Pending_4 into the Experts directory.
  3. If you want to move the files to a different location, you may need to adjust the include files.
  4. Compile the EA's and test them.

This system has only had some basic testing. It has not been tested in a live environment or incorporated into practical trading system yet, so please take great care and beware that bugs may exist.

I consider this a work in progress that I hope to improve upon later, when I have more time available.

S4T_DaysOfTheWeek S4T_DaysOfTheWeek

The indicator marks the days of the week with a colored histogram in the chart sub-window.

Multicurrency hedge example EA (overlay hedge) Multicurrency hedge example EA (overlay hedge)

The example of multicurrency hedging implementation on a single chart in Metatrader 4.

All In One Divergence All In One Divergence

Indicator to trade divergence. One of 30 indicators can be selected.

Simpler Trend Simpler Trend

Get a grasp of the current trend by candle colors.