Open a powershell and paste the following code into the console. Leave the powershell console open and minimized in the background. No more gaps
UPDATE: spoke to soon. Still getting Gaps.
Ninjatrader: Please ask your test team to set their time zone in Ninjatrader and in windows to GMT and disable NT historical data servers and use Ninjatrader for a few days. Load data on several instruments. Close down then go home for the day. Open the same chart the following day - you should see gaps. The previous day will end at 12:00 midnight and the next day will start at 10:00pm.
NB - ignore this powershell script it doesn't help
$ntDataFolder = "$env:USERPROFILE\Documents\NinjaTrader 8\db\"
$folderMatches = "(cache|day|minute|tick)"
$directories = dir -Directory $ntDataFolder | Where-Object {$_.Name -match $folderMatches}
$result = @($directories | % {
$dir = $_.FullName;
Get-ChildItem -Path $dir -Include * -File -Recurse | foreach { $_.Delete()}
$fsw = New-Object IO.FileSystemWatcher $dir, '*' -Property @{
IncludeSubdirectories = $true
NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'
};
$oc = Register-ObjectEvent $fsw Created -Action {
$path = $Event.SourceEventArgs.FullPath;
$name = $Event.SourceEventArgs.Name;
$changeType = $Event.SourceEventArgs.ChangeType;
$timeStamp = $Event.TimeGenerated;
Write-Host "The file '$name' was $changeType and flushed at $timeStamp";
Remove-Item $path;
};
new-object PSObject -Property @{ Watcher = $fsw; OnCreated = $oc };
});
Leave a comment: