Page 1 of 1

Help with something simple

PostPosted: Tue Dec 06, 2016 1:06 pm
by cnikitopoulos94
Hello All,

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.

Re: Help with something simple

PostPosted: Thu Dec 15, 2016 1:43 am
by cnikitopoulos94
Bump. AnyBody?

Re: Help with something simple

PostPosted: Sun Dec 18, 2016 11:55 am
by Apprentice
U can use End of Turn_Live Execution Strategy Template.lua
viewtopic.php?f=28&t=2712