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

custom trail-stop by MA - update 4 - MetaTrader 5용 expert

조회수:
8840
평가:
(14)
게시됨:
2020.06.21 02:30
업데이트됨:
2020.07.24 19:43
my_ts15.mq5 (10.6 KB) 조회
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

this is my first try at creating an EA from ground up

the EA only trails, so no automatic buy/sell

***** PLEASE NOTE: the default values are adjusted for M1 time-frame, as is the easiest way i got for testing it's workings, but it works in all time-frames and currency pairs *****


besides the MA parameters, it also got a few options for the trailing

  • possibility of enforcing a maximum stop loss - for older orders that might exceed it
  • number of bars behind to use in MA trail
  • minimum distance from MA to trail
  • minimum distance of current price to trail on positive and on negative profit
  • possibility of not showing indicator line
  • trail step


the code probably can be optimized further

feel free to post suggestions, changes to the code that can improve it, or any doubts about it's workings


i have been trying to control the indicator`s appearance - line, color and style. any help will be welcome


Update 1 (V1.1)
  • file updated after consideration on how to treat preexisting orders that exceed max sl and the EA don`t have permission to close them

Update 2 (V1.2)

  • logic errors in the trail system
  • added possibility of hiding/showing graphic line on chart

Update 3 (V1.3)

  • added trail step

Update 3.1

  • fixed some logic errors (yes i still keep finding them ^^)

Update 4

  • a lot of mistakes where identified and corrected, affecting some minor changes in the trail method


coming soon: class library

Basic List Basic List

A basic container for storing an ordered list of basic data type objects.

Object List Object List

A basic container for storing an ordered list of objects.

Pan PrizMA CD Phase Sin leverage 72 Pan PrizMA CD Phase Sin leverage 72

Calculates the phase and amplitude of the expected wave

Forex market sessions identification Forex market sessions identification

This script highlights Forex sessions for Sydney, Tokyo, London and New York with colored rectangles, according to the user time definitions.