There is a simple CCI based strategy, which enters to market when CCI indicators closed zero line.
Moderator: admin
JaimeO wrote:I just can't seem to figure out how it is all put together...
function ExtUpdate is the core of the call but how does this
"if (CCI.CCI[period - 1] <= 0 and CCI.CCI[period] > 0) then"
equate to this?
-- Open BUY (Long) position if MACD line crosses over SIGNAL line
-- in negative area below openLevel. Also check MA trend if
-- confirmTrend flag is 'true'
Any help is very much appreciated
-JO
local CHECK_CONDITIONS=12345;
function Prepare()
...
local timerIntervalSeconds = 60; -- run checks each menute
core.host:execute("setTimer", CHECK_CONDITIONS, timerIntervalSeconds);
...
end
function ExtAsyncOperationFinished(cookie, success, message)
if cookie == CHECK_CONDITIONS then
-- call checks
ExtUpdate(2, source, source:size() - 1);
end
end
function ReleaseInstance()
core.host:execute("killTimer", CHECK_CONDITIONS);
end
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 24 guests