Page 1 of 1

TMA Reverse

PostPosted: Tue Dec 17, 2019 3:55 pm
by EZB-Schmarotzer
Dear Sir,

could you please convert the following code from ProRealtime into an MT4 expert advisor?



---------------------

defparam cumulateorders = false

// parameters
HalfLength = 141 //please add this as a variable
AtrLength = 141 //please add this as a variable
AtrMultiplier = 2.4 //please add this as a variable

avg = average [1](close)

sum = (HalfLength+1)*avg
sumw = (HalfLength+1)
k = HalfLength

for j = 1 to HalfLength do
k = k-1
sum = sum+(k*avg[j])
sumw = sumw+k
next


myrange = AverageTrueRange[AtrLength](close)*AtrMultiplier

middleband = sum/sumw
//higherband = buffer1+myrange
lowerband = middleband-myrange
upperband = middleband+myrange


TradingDay = opendayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5

IF TradingDay then
if average [1] (close) crosses over lowerband then
buy at market
endif
Endif

if average [1] (close) crosses over middleband then
sell at market
endif

IF TradingDay then
if average [1] (close) crosses under upperband then
sellshort at market
endif
Endif

if average [1] (close) crosses under middleband then
exitshort at market
endif


set stop %loss 3
set target %profit 3 // as insurance

Re: TMA Reverse

PostPosted: Wed Dec 18, 2019 4:31 pm
by Apprentice
Your request is added to the development list.
Development reference 451.

Re: TMA Reverse

PostPosted: Thu Dec 19, 2019 11:43 am
by Apprentice

Re: TMA Reverse

PostPosted: Thu Jan 02, 2020 7:09 am
by henryfxcodebase
Dear Apprentice,I humbly request, if this TMA Reverse could be coded in lua for TS both as indicator and strategy. thanks

Re: TMA Reverse

PostPosted: Fri Jan 03, 2020 4:04 am
by Apprentice
Your request is added to the development list.
Development reference 515.

Re: TMA Reverse

PostPosted: Fri Jan 03, 2020 8:01 am
by Apprentice