X Machinge Techical Requirements 8/22/2020 I. Task- Create an expert advisor and indicator in mql4, by translating a Tradingview strategy written in Pinescript language. a) The EA should be able to execute live trades in real time. b) The EA will run on a dedicated server in parallel with a mobile android platform and a desktop computer. Commands from the desktop should be primary, the mobile is secondary, and commands on the server are tertiary. c) The EA should work using different brokers. d) The EA should work with all available financial instruments. e) The EA should work with 4 and 5 digit quotes. f) The EA must be able to calculate & use trading signals generated on a resolution that may be different than the resolution being used on the screen at the time (i.e. viewing 5 min time frame, but trades based on the 30 min time frame. g) The EA should have the ability to control the hours that it trades, and when it should not seek new trades. II. RISK a) There should be two options for determining lot size. 1. Risk1=fixed position size 2. Risk2= If Balance>Balance[1], Increase position size by (balance*0.0001)rounded to nearest mini lot, If Balance0 or BUY>[EXTERN Fixed amount] c) Sell=SELL<0 or SELL<[Extern Fixed amount] IV. Market Exit a) TP1 (Exit BUY)=SELL or BUY<[EXTERN Fixed amount] or Fixed TP (in pips). b) TP2 (Exit SELL)=BUY or SELL>[EXTERN Fixed amount] or Fixed TP (in pips). V. Stop Loss- Fixed SL, or Custom with 4 possible options a) SL1 = Fixed SL b) SL2 (custom)= SL1 IF Profit<0, THEN IF profit> go to BREAKEVEN + [EXTERN value in pips]. If profit > [BREAKEVEN+pips], then SL becomes: i) option 1- high-[EXTERN amount in pips] if BUY; [EXTERN] amount in pips]-low, if SELL, OR ii) option 2- (high[1]-low[1])/[EXTERN denominator,default=2] OR iii) option 3- (Trailing Profit in [EXTERN pips] increments) OR iv) option 4- high-close>close-[EXTERN amount in pips] (if buy); close-low> [EXTERN amount in pips]-close (if SELL). c) The goal of the custom stoploss setting is to manage the trade from open, to breakeven, to profit. Perhaps there are more precise functions within MQL that will accomplish each option, but the goal of option 1 is to have the SL as a function of a higher high (if BUY) or lower low (if SELL). The goal of option 2 is to have the SL as a function of the PREVIOUS distance between the high & low. The goal of option 3 is to have a trailing stop once the breakeven threshold has been passed. The goal of option 4 is to have the SL as a function of the CURRENT intrabar highs and lows vs. the change in the close price. d) SAFETY- 1) Exit all trades if (Percent of balance lost)>[EXTERN percent of balance]. 2) No entry if the spread is greater than [EXTERN] number of pips. 3) No entry on gap up or gap down bars from the previous bar. 4) No entry after intra bar[EXTERN number of attempts]. VI. The Tradingview Code for X Machine strategy("X Machine", overlay=false) a=change(open)+change(high)+change(low)+change(close) buy1=cum(close>open and a<0?change(close):a) buy2=cum(close>open and a>0?change(close):a) sell1=cum(close0?change(close):a) sell2=cum(close0 //or b2>input amount SELL=s2<0 //or s2