Page 1 of 1

Simple Index Trader

PostPosted: Mon Oct 28, 2019 9:49 pm
by EZB-Schmarotzer
Hi everyone :)

Can you please convert this code from ProRealtime language (based on BASIC, so it's quite simple) into an MQL 4 Expert Advisor?



// PARAMETERS
DEFPARAM CumulateOrders = False
DEFPARAM flatafter = 210000

// Stops and TPs

myTarget=5*AverageTrueRange[14](close)
myStop=1*AverageTrueRange[14](close)

// Indicators
MM = Average[200](close)
iMACD = MACD[12,26,9](close)

// Buy
ca1 = close > MM
ca2 = iMACD > 0

IF ca1 AND ca2 AND time >= 090000 THEN
BUY AT MARKET
ENDIF

// Sell
cv1 = close < MM
cv2 = iMACD < 0

IF cv1 AND cv2 AND time >= 090000 THEN
SELLSHORT AT MARKET
ENDIF

// Objectives
SET STOP LOSS myStop
SET TARGET PROFIT myTarget

Re: Simple Index Trader

PostPosted: Tue Oct 29, 2019 6:27 am
by Apprentice
Your request is added to the development list.
Development reference 257.

Re: Simple Index Trader

PostPosted: Fri Nov 01, 2019 7:21 am
by Apprentice