Market Meanness Index

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Market Meanness Index

Postby Moritz87 » Tue Jan 10, 2017 11:19 am

Hello,

can you please code the Market-Meanness-Index for FXCMs Trading-Station for me?
I already have the Code here, but I have no knowledge of LUA...

Code is as follows:

Code: Select all
// Set Inputs
inputLength=input(300)
topband=input(76)
bottomband=input(74)

// Get Average Price Change
mean(price1, price2, length) =>
    sum = 0
    for i = 0 to length
        if price1[i] - price2[i] > 0
            sum := sum + (price1[i] - price2[i])
        else
            sum := sum + (price2[i] - price1[i])
    sum / length

// Market Meaness Index Function
MMI(price1,price2, length) =>
    m = mean(open,close,inputLength)
    nh = 0
    nl = 0
    for i = 1 to length
        if price1[i] - price2[i] > 0
            if (price1[i] - price2[i]) > m
                if (price1[i] - price2[i]) > (price1[i+1] - price2[i+1])
                    nl := nl + 1
        else
            if (price2[i] - price1[i]) < m
                if (price2[i] - price1[i]) < (price2[i+1] - price1[i+1])
                    nh := nh + 1
    100 - 100*(nl + nh)/(length - 1)
   
u=plot(topband)
l=plot(bottomband)
t=plot(90)
b=plot(60)
fill(u,l,black)
fill(t,u,yellow)
fill(b,l,blue)
plot(MMI(open,close,inputLength))


Thank you very much in advance!!!
Moritz87
 
Posts: 5
Joined: Sun Mar 01, 2015 12:49 pm



Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 21 guests