Hello,
Can you convert this into a .lua file? Thanks.
http://forexarena.blogspot.com/2009/09/ ... cator.html
Moderator: admin
Nikolay.Gekht wrote:I've added the requests for all your post to the dev. queue. It will take some time to implement them all.
function Init()
indicator:name("BykovTrend");
indicator:description("BykovTrend")
indicator:requiredSource(core.Bar);
indicator:type(core.Indicator);
indicator.parameters:addInteger("RISK", "RISK", "", 3);
indicator.parameters:addInteger("SSP", "SSP", "", 9);
indicator.parameters:addColor("UpC", "Up color", "", core.rgb(255, 0, 0));
indicator.parameters:addColor("DownC", "Down color", "", core.rgb(0, 255, 0));
end
local source=nil;
local UP=nil;
local DN=nil;
local RISK;
local SSP;
local first;
local wpr;
local uptrend=nil;
local old=nil;
function Prepare()
source = instance.source;
local name = profile:id();
RISK = instance.parameters.RISK;
SSP = instance.parameters.SSP;
wpr = core.indicators:create("WILLIAMSPERCENTRANGE", source, SSP);
first = wpr.DATA:first()+SSP;
instance:name(name);
UP = instance:createTextOutput ("Up", "Up", "Wingdings", 10, core.H_Center, core.V_Top, instance.parameters.UpC, first);
DN = instance:createTextOutput ("Dn", "Dn", "Wingdings", 10, core.H_Center, core.V_Bottom, instance.parameters.DownC, first);
end
function Update(period, mode)
if (period > first) then
wpr:update(mode);
local K=33-RISK;
if wpr.DATA[period]<-100+K then
uptrend=false;
end
if wpr.DATA[period]>-K then
uptrend=true;
end
if uptrend~=old and uptrend==true then
UP:set(period, source.low[period]-30*source:pipSize(), "\225", "Classic bullish");
end
if uptrend~=old and uptrend==false then
DN:set(period, source.high[period]+30*source:pipSize(), "\226", "Classic bullish");
end
old=uptrend;
end
end
Return to Indicator and Signal Requests
Users browsing this forum: No registered users and 32 guests