I was hoping that I could get some help since I'm still alittle new in programming. I have run into a little predicament. My intentions is for "HaveTrades" to run through Tick, but all of my indicators to run through End of Turn. (Separate Sources)
I have two types of ExtSubscribe
- Code: Select all
if executiontype== "Live" then
TickSource = ExtSubscribe(1, nil, "t1", instance.parameters.Type == "Bid", "close");
end
Source = ExtSubscribe(2, nil, instance.parameters.TF, instance.parameters.Type == "Bid", "bar");
Now this part of code below is in the ExtUpdate
- Code: Select all
function ExtUpdate(id, source, period) -- The method called every time when a new bid or ask price appears.
now = core.host:execute("getServerTime");
-- get only time
now = now - math.floor(now);
-- check whether the time is in the exit time period
if not(now >= OpenTime
and now <= CloseTime)
then
return ;
end
if AllowTrade then
if not(checkReady("trades")) or not(checkReady("orders")) then
return ;
end
end
if ExecutionType == "Live" and id == 1 then
period= core.findDate (Source.close, TickSource:date(period), false );
end
if ExecutionType == "Live" then
if ONE == Source:serial(period) then
return;
end
if id == 2 then
return;
end
else
if id ~= 2 then
return;
end
end
So the problem is as such
1. If execution type is End of Turn it wont have "LIVE" for HaveTrades. So I just want the HaveTrades table to refresh at a "T1" time frame instead of waiting for period to "End Turn".
Any help would be greatly appreciated.