Code: Select all
save_global_data( SymbolName, ADE.TypeZeroInterval(TypeCode, IntervalSize), ADE.TypeZeroBarID_s,"_MyMovAvg", MyMovAvg);
ADE.TypeZeroBarID_s function as i have some problems since the miliseconds are introduced in MC 8.
Do i only need to change time_s with datetime at the following code?
Code: Select all
[LegacyColorValue = TRUE];
Vars:
BarInfo(ListN.New);
if CurrentBar = 1 and ListN.Count(BarInfo) = 0 then begin
Value1 = ListN.PushBack(BarInfo, CurrentBar);
Value1 = ListN.PushBack(BarInfo, Time_s);
Value1 = ListN.PushBack(BarInfo, 1); // bar counter
end;
if CurrentBar <> ListN.Get(BarInfo, 1) then begin // are we on a new bar?
if Time_s <> ListN.Get(BarInfo, 2) then // has bar time changed?
Value1 = ListN.Put(BarInfo, 3, 1) // reset counter to 1
else
Value1 = ListN.Put(BarInfo, 3, ListN.Get(BarInfo, 3) + 1); // increment counter
// Store new bar number and time
Value1 = ListN.Put(BarInfo, 1, CurrentBar);
Value1 = ListN.Put(BarInfo, 2, Time_s);
end;
// before here was "Time" - HHMM - delimeter = 10000, now "Time_s" - HHMMss - delimeter = 1000000 {ADDED ADDITIONAL "0"}{MIKE ADDED 000}
ADE.TypeZeroBarID_s = Date + ListN.Get(BarInfo, 2) / 1000000000+ ListN.Get(BarInfo, 3) / 1000000000;