Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d85a46ba19 | |||
| fcadf5438a | |||
| 0181e56f84 | |||
| 10e1c87ec1 | |||
| aa13085fd3 |
@@ -32,7 +32,7 @@ namespace MarketData.CNNProcessing
|
|||||||
DataProcessor dataProcessor=new DataProcessor();
|
DataProcessor dataProcessor=new DataProcessor();
|
||||||
dataProcessor.Width=dimension;
|
dataProcessor.Width=dimension;
|
||||||
dataProcessor.Height=dimension;
|
dataProcessor.Height=dimension;
|
||||||
dataProcessor.PenWidthArray=new float[]{.75f,1.00f,1.12f};
|
dataProcessor.PenWidthArray=new float[]{.25f,.50f,.75f,1.00f,1.50f,2.00f};
|
||||||
|
|
||||||
if(!rootFolder.EndsWith(@"\"))rootFolder+=@"\";
|
if(!rootFolder.EndsWith(@"\"))rootFolder+=@"\";
|
||||||
// [0] Data - The avoid data
|
// [0] Data - The avoid data
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace MarketData.CNNProcessing
|
|||||||
PenWidth=2f;
|
PenWidth=2f;
|
||||||
DrawingBrush=new SolidBrush(Color.Black);
|
DrawingBrush=new SolidBrush(Color.Black);
|
||||||
DrawingBrushRed=new SolidBrush(Color.Red);
|
DrawingBrushRed=new SolidBrush(Color.Red);
|
||||||
|
DrawingBrushGreen=new SolidBrush(Color.Green);
|
||||||
FillBrush=new SolidBrush(Color.White);
|
FillBrush=new SolidBrush(Color.White);
|
||||||
DrawPrice=true;
|
DrawPrice=true;
|
||||||
UseGrayScale=false;
|
UseGrayScale=false;
|
||||||
@@ -60,12 +61,19 @@ namespace MarketData.CNNProcessing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
///<param name="value">Gets/Sets the drawing brush brush</param>
|
///<param name="value">Gets/Sets the drawing brush brush</param>
|
||||||
public Brush DrawingBrush{get;set;}
|
public Brush DrawingBrush{get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DrawingBrush
|
/// DrawingBrushRed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
///<param name="value">Gets/Sets the drawing brush brush</param>
|
///<param name="value">Gets/Sets the drawing brush brush</param>
|
||||||
public Brush DrawingBrushRed{get;set;}
|
public Brush DrawingBrushRed{get;set;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DrawingBrushGreen
|
||||||
|
/// </summary>
|
||||||
|
///<param name="value">Gets/Sets the drawing brush brush</param>
|
||||||
|
public Brush DrawingBrushGreen{get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DrawBlack
|
/// DrawBlack
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -312,6 +320,7 @@ namespace MarketData.CNNProcessing
|
|||||||
|
|
||||||
Pen pen=new Pen(DrawingBrush,penWidth);
|
Pen pen=new Pen(DrawingBrush,penWidth);
|
||||||
Pen redPen=new Pen(DrawingBrushRed,penWidth);
|
Pen redPen=new Pen(DrawingBrushRed,penWidth);
|
||||||
|
Pen greenPen= new Pen(DrawingBrushGreen,penWidth);
|
||||||
ImageHelper imageHelper=new ImageHelper();
|
ImageHelper imageHelper=new ImageHelper();
|
||||||
|
|
||||||
PointMapping pointMapping=new PointMapping(Width,Height,maxX,minX,maxY,minY);
|
PointMapping pointMapping=new PointMapping(Width,Height,maxX,minX,maxY,minY);
|
||||||
@@ -319,7 +328,7 @@ namespace MarketData.CNNProcessing
|
|||||||
imageHelper.Fill(FillBrush);
|
imageHelper.Fill(FillBrush);
|
||||||
|
|
||||||
LineSegments lineSegments=new LineSegments();
|
LineSegments lineSegments=new LineSegments();
|
||||||
// draw volatility
|
// draw volatility - red pen
|
||||||
for(int index=0;index<v.Length;index++)
|
for(int index=0;index<v.Length;index++)
|
||||||
{
|
{
|
||||||
if(0==index)continue;
|
if(0==index)continue;
|
||||||
@@ -329,7 +338,7 @@ namespace MarketData.CNNProcessing
|
|||||||
}
|
}
|
||||||
imageHelper.DrawPath(redPen,lineSegments);
|
imageHelper.DrawPath(redPen,lineSegments);
|
||||||
|
|
||||||
// draw prices
|
// draw prices - black pen
|
||||||
lineSegments.Clear();
|
lineSegments.Clear();
|
||||||
for(int index=0;index<close.Length && DrawPrice;index++)
|
for(int index=0;index<close.Length && DrawPrice;index++)
|
||||||
{
|
{
|
||||||
@@ -339,7 +348,7 @@ namespace MarketData.CNNProcessing
|
|||||||
lineSegments.Add(p1,p2);
|
lineSegments.Add(p1,p2);
|
||||||
}
|
}
|
||||||
imageHelper.DrawPath(pen,lineSegments);
|
imageHelper.DrawPath(pen,lineSegments);
|
||||||
// draw k
|
// draw k - green pen
|
||||||
lineSegments.Clear();
|
lineSegments.Clear();
|
||||||
for(int index=0;index<k.Length;index++)
|
for(int index=0;index<k.Length;index++)
|
||||||
{
|
{
|
||||||
@@ -348,9 +357,9 @@ namespace MarketData.CNNProcessing
|
|||||||
Point p2=new Point(index,(int)k[index]);
|
Point p2=new Point(index,(int)k[index]);
|
||||||
lineSegments.Add(p1,p2);
|
lineSegments.Add(p1,p2);
|
||||||
}
|
}
|
||||||
imageHelper.DrawPath(pen,lineSegments);
|
imageHelper.DrawPath(greenPen,lineSegments);
|
||||||
|
|
||||||
// draw l
|
// draw l - green pen
|
||||||
lineSegments.Clear();
|
lineSegments.Clear();
|
||||||
for(int index=0;index<l.Length;index++)
|
for(int index=0;index<l.Length;index++)
|
||||||
{
|
{
|
||||||
@@ -359,8 +368,7 @@ namespace MarketData.CNNProcessing
|
|||||||
Point p2=new Point(index,(int)l[index]);
|
Point p2=new Point(index,(int)l[index]);
|
||||||
lineSegments.Add(p1,p2);
|
lineSegments.Add(p1,p2);
|
||||||
}
|
}
|
||||||
imageHelper.DrawPath(pen,lineSegments);
|
imageHelper.DrawPath(greenPen,lineSegments);
|
||||||
|
|
||||||
|
|
||||||
if(0.00!=noise)imageHelper.AddNoise(NoiseColor,noise);
|
if(0.00!=noise)imageHelper.AddNoise(NoiseColor,noise);
|
||||||
if(testCase.TypeOutput.Equals(TestCase.OutputType.OutputFile))
|
if(testCase.TypeOutput.Equals(TestCase.OutputType.OutputFile))
|
||||||
@@ -369,12 +377,10 @@ namespace MarketData.CNNProcessing
|
|||||||
if(File.Exists(testCase.LastPathFileName))File.Delete(testCase.LastPathFileName);
|
if(File.Exists(testCase.LastPathFileName))File.Delete(testCase.LastPathFileName);
|
||||||
if(UseGrayScale)imageHelper.SaveGrayScaleJPG(testCase.LastPathFileName);
|
if(UseGrayScale)imageHelper.SaveGrayScaleJPG(testCase.LastPathFileName);
|
||||||
else imageHelper.Save(testCase.LastPathFileName);
|
else imageHelper.Save(testCase.LastPathFileName);
|
||||||
// else imageHelper.SaveBlackAndWhiteJPG(testCase.LastPathFileName);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
testCase.Streams.Add(imageHelper.ToStream());
|
testCase.Streams.Add(imageHelper.ToStream());
|
||||||
// testCase.Streams.Add(imageHelper.SaveBlackAndWhiteJPG());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using System.Threading;
|
|||||||
using MarketData.MarketDataModel;
|
using MarketData.MarketDataModel;
|
||||||
using MarketData.Utils;
|
using MarketData.Utils;
|
||||||
using MarketData.Helper;
|
using MarketData.Helper;
|
||||||
using MarketData.Numerical;
|
|
||||||
using MarketData.DataAccess;
|
using MarketData.DataAccess;
|
||||||
|
|
||||||
namespace MarketData.Cache
|
namespace MarketData.Cache
|
||||||
@@ -43,6 +42,7 @@ namespace MarketData.Cache
|
|||||||
|
|
||||||
public class GBPriceCache : IDisposable
|
public class GBPriceCache : IDisposable
|
||||||
{
|
{
|
||||||
|
private static readonly int EVICTION_DAYCOUNT=252; // upon eviction trigger remove all data older than maxdate - evictionPolicyThreshholdDays
|
||||||
private Thread cacheMonitorThread = null;
|
private Thread cacheMonitorThread = null;
|
||||||
private volatile bool threadRun = true;
|
private volatile bool threadRun = true;
|
||||||
private Object thisLock = new Object();
|
private Object thisLock = new Object();
|
||||||
@@ -61,6 +61,11 @@ namespace MarketData.Cache
|
|||||||
cacheMonitorThread.Start();
|
cacheMonitorThread.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// GetInstance
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ObjectDisposedException"></exception>
|
||||||
public static GBPriceCache GetInstance()
|
public static GBPriceCache GetInstance()
|
||||||
{
|
{
|
||||||
lock (typeof(GBPriceCache))
|
lock (typeof(GBPriceCache))
|
||||||
@@ -81,6 +86,11 @@ namespace MarketData.Cache
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Shuts down the cache and stops the monitor thread. This is a full application-level
|
||||||
|
/// shutdown. Callers should always access the cache via GetInstance() and not hold
|
||||||
|
/// long-lived references to the instance.
|
||||||
|
/// </summary>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
lock (thisLock)
|
lock (thisLock)
|
||||||
@@ -97,40 +107,15 @@ namespace MarketData.Cache
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearCacheOnOrBefore(DateTime onOrBeforeDate, bool collect = false)
|
|
||||||
{
|
|
||||||
lock (thisLock)
|
|
||||||
{
|
|
||||||
Dictionary<String, PricesByDate> newPriceCache = new Dictionary<String, PricesByDate>();
|
|
||||||
foreach (KeyValuePair<String, PricesByDate> entry in snapshot.PriceCache)
|
|
||||||
{
|
|
||||||
String symbol = entry.Key;
|
|
||||||
PricesByDate filteredPrices = new PricesByDate();
|
|
||||||
PricesByDate existingPrices = entry.Value;
|
|
||||||
foreach (KeyValuePair<DateTime, Price> kvp in existingPrices)
|
|
||||||
{
|
|
||||||
if (kvp.Key >= onOrBeforeDate)
|
|
||||||
{
|
|
||||||
filteredPrices.Add(kvp.Key, kvp.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (filteredPrices.Count > 0)
|
|
||||||
{
|
|
||||||
newPriceCache.Add(symbol, filteredPrices);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UpdateSnapshot(newPriceCache, snapshot.RealTimePriceCache, snapshot.NullCache);
|
|
||||||
if (collect) GC.Collect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Price GetPriceOrLatestAvailable(String symbol, DateTime date)
|
public Price GetPriceOrLatestAvailable(String symbol, DateTime date)
|
||||||
{
|
{
|
||||||
Price price = GetPrice(symbol, date);
|
Price price = GetPrice(symbol, date);
|
||||||
if (null != price) return price;
|
if (null != price) return price;
|
||||||
|
|
||||||
DateTime latestPricingDate = PricingDataAccess.GetLatestDateOnOrBefore(symbol, date);
|
DateTime latestPricingDate = PricingDataAccess.GetLatestDateOnOrBefore(symbol, date);
|
||||||
price = GetPrice(symbol, latestPricingDate);
|
price = GetPrice(symbol, latestPricingDate);
|
||||||
if (null != price) return price;
|
if (null != price) return price;
|
||||||
|
|
||||||
fetchSemaphore.Wait();
|
fetchSemaphore.Wait();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -140,7 +125,8 @@ namespace MarketData.Cache
|
|||||||
{
|
{
|
||||||
fetchSemaphore.Release();
|
fetchSemaphore.Release();
|
||||||
}
|
}
|
||||||
if (null !=price) AddPrice(price);
|
|
||||||
|
if (null != price) AddPrice(price);
|
||||||
return price;
|
return price;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,27 +138,33 @@ namespace MarketData.Cache
|
|||||||
}
|
}
|
||||||
|
|
||||||
Price price = MarketDataHelper.GetLatestPrice(symbol);
|
Price price = MarketDataHelper.GetLatestPrice(symbol);
|
||||||
|
|
||||||
if (null != price)
|
if (null != price)
|
||||||
{
|
{
|
||||||
Dictionary<String, Price> newRealtime = new Dictionary<String, Price>(snapshot.RealTimePriceCache);
|
Dictionary<String, Price> newRealtime = new Dictionary<String, Price>(snapshot.RealTimePriceCache);
|
||||||
newRealtime.Add(symbol, price);
|
newRealtime.Add(symbol, price);
|
||||||
UpdateSnapshot(snapshot.PriceCache, newRealtime, snapshot.NullCache);
|
UpdateSnapshot(snapshot.PriceCache, newRealtime, snapshot.NullCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
return price;
|
return price;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Price GetPrice(String symbol, DateTime date)
|
public Price GetPrice(String symbol, DateTime date)
|
||||||
{
|
{
|
||||||
date = date.Date;
|
date = date.Date;
|
||||||
|
|
||||||
if (!ContainsPrice(symbol, date))
|
if (!ContainsPrice(symbol, date))
|
||||||
{
|
{
|
||||||
String key = symbol + Utility.DateTimeToStringMMHDDHYYYY(date);
|
String key = symbol + Utility.DateTimeToStringMMHDDHYYYY(date);
|
||||||
|
|
||||||
if (snapshot.NullCache.ContainsKey(key))
|
if (snapshot.NullCache.ContainsKey(key))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchSemaphore.Wait();
|
fetchSemaphore.Wait();
|
||||||
Price price;
|
Price price;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
price = PricingDataAccess.GetPrice(symbol, date);
|
price = PricingDataAccess.GetPrice(symbol, date);
|
||||||
@@ -181,7 +173,8 @@ namespace MarketData.Cache
|
|||||||
{
|
{
|
||||||
fetchSemaphore.Release();
|
fetchSemaphore.Release();
|
||||||
}
|
}
|
||||||
if (null ==price)
|
|
||||||
|
if (null == price)
|
||||||
{
|
{
|
||||||
Dictionary<String, bool> newNullCache = new Dictionary<String, bool>(snapshot.NullCache);
|
Dictionary<String, bool> newNullCache = new Dictionary<String, bool>(snapshot.NullCache);
|
||||||
newNullCache.Add(key, true);
|
newNullCache.Add(key, true);
|
||||||
@@ -191,23 +184,29 @@ namespace MarketData.Cache
|
|||||||
|
|
||||||
AddPrice(price);
|
AddPrice(price);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!snapshot.PriceCache.ContainsKey(symbol)) return null;
|
if (!snapshot.PriceCache.ContainsKey(symbol)) return null;
|
||||||
|
|
||||||
PricesByDate pricesByDate = snapshot.PriceCache[symbol];
|
PricesByDate pricesByDate = snapshot.PriceCache[symbol];
|
||||||
if (!pricesByDate.ContainsKey(date)) return null;
|
if (!pricesByDate.ContainsKey(date)) return null;
|
||||||
|
|
||||||
return pricesByDate[date];
|
return pricesByDate[date];
|
||||||
}
|
}
|
||||||
|
|
||||||
public Prices GetPrices(String symbol, DateTime earlierDate, DateTime laterDate)
|
public Prices GetPrices(String symbol, DateTime earlierDate, DateTime laterDate)
|
||||||
{
|
{
|
||||||
DateGenerator localDateGenerator = new DateGenerator();
|
DateGenerator localDateGenerator = new DateGenerator();
|
||||||
|
|
||||||
if (laterDate < earlierDate)
|
if (laterDate < earlierDate)
|
||||||
{
|
{
|
||||||
DateTime tempDate = earlierDate;
|
DateTime tempDate = earlierDate;
|
||||||
earlierDate = laterDate;
|
earlierDate = laterDate;
|
||||||
laterDate = tempDate;
|
laterDate = tempDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<DateTime> datesList = localDateGenerator.GenerateHistoricalDates(earlierDate, laterDate);
|
List<DateTime> datesList = localDateGenerator.GenerateHistoricalDates(earlierDate, laterDate);
|
||||||
datesList = datesList.Where(x => x >= earlierDate).ToList();
|
datesList = datesList.Where(x => x >= earlierDate).ToList();
|
||||||
|
|
||||||
return GetPrices(symbol, laterDate, datesList.Count);
|
return GetPrices(symbol, laterDate, datesList.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,17 +214,20 @@ namespace MarketData.Cache
|
|||||||
{
|
{
|
||||||
List<DateTime> historicalDates = dateGenerator.GenerateHistoricalDates(startDate, dayCount + 60);
|
List<DateTime> historicalDates = dateGenerator.GenerateHistoricalDates(startDate, dayCount + 60);
|
||||||
List<DateTime> missingDates = new List<DateTime>();
|
List<DateTime> missingDates = new List<DateTime>();
|
||||||
|
|
||||||
foreach (DateTime historicalDate in historicalDates)
|
foreach (DateTime historicalDate in historicalDates)
|
||||||
{
|
{
|
||||||
if (!ContainsPrice(symbol, historicalDate))
|
if (!ContainsPrice(symbol, historicalDate))
|
||||||
{
|
{
|
||||||
String key = symbol + Utility.DateTimeToStringMMHDDHYYYY(historicalDate);
|
String key = symbol + Utility.DateTimeToStringMMHDDHYYYY(historicalDate);
|
||||||
|
|
||||||
if (!snapshot.NullCache.ContainsKey(key))
|
if (!snapshot.NullCache.ContainsKey(key))
|
||||||
{
|
{
|
||||||
missingDates.Add(historicalDate);
|
missingDates.Add(historicalDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (missingDates.Count > 0)
|
if (missingDates.Count > 0)
|
||||||
{
|
{
|
||||||
DateTime minDate = missingDates.Min();
|
DateTime minDate = missingDates.Min();
|
||||||
@@ -233,6 +235,7 @@ namespace MarketData.Cache
|
|||||||
|
|
||||||
fetchSemaphore.Wait();
|
fetchSemaphore.Wait();
|
||||||
Prices loadedPrices;
|
Prices loadedPrices;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
loadedPrices = PricingDataAccess.GetPrices(symbol, maxDate, minDate);
|
loadedPrices = PricingDataAccess.GetPrices(symbol, maxDate, minDate);
|
||||||
@@ -249,11 +252,14 @@ namespace MarketData.Cache
|
|||||||
}
|
}
|
||||||
|
|
||||||
Prices prices = new Prices();
|
Prices prices = new Prices();
|
||||||
|
|
||||||
foreach (DateTime historicalDate in historicalDates)
|
foreach (DateTime historicalDate in historicalDates)
|
||||||
{
|
{
|
||||||
if (!snapshot.PriceCache.ContainsKey(symbol)) continue;
|
if (!snapshot.PriceCache.ContainsKey(symbol)) continue;
|
||||||
|
|
||||||
PricesByDate pricesByDate = snapshot.PriceCache[symbol];
|
PricesByDate pricesByDate = snapshot.PriceCache[symbol];
|
||||||
if (!pricesByDate.ContainsKey(historicalDate)) continue;
|
if (!pricesByDate.ContainsKey(historicalDate)) continue;
|
||||||
|
|
||||||
prices.Add(pricesByDate[historicalDate]);
|
prices.Add(pricesByDate[historicalDate]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,17 +274,21 @@ namespace MarketData.Cache
|
|||||||
lock (thisLock)
|
lock (thisLock)
|
||||||
{
|
{
|
||||||
PricesByDate pricesByDate;
|
PricesByDate pricesByDate;
|
||||||
|
|
||||||
if (!snapshot.PriceCache.ContainsKey(price.Symbol))
|
if (!snapshot.PriceCache.ContainsKey(price.Symbol))
|
||||||
{
|
{
|
||||||
pricesByDate = new PricesByDate();
|
pricesByDate = new PricesByDate();
|
||||||
pricesByDate.Add(price.Date, price);
|
pricesByDate.Add(price.Date, price);
|
||||||
|
|
||||||
Dictionary<String, PricesByDate> newCache = new Dictionary<String, PricesByDate>(snapshot.PriceCache);
|
Dictionary<String, PricesByDate> newCache = new Dictionary<String, PricesByDate>(snapshot.PriceCache);
|
||||||
newCache.Add(price.Symbol, pricesByDate);
|
newCache.Add(price.Symbol, pricesByDate);
|
||||||
|
|
||||||
UpdateSnapshot(newCache, snapshot.RealTimePriceCache, snapshot.NullCache);
|
UpdateSnapshot(newCache, snapshot.RealTimePriceCache, snapshot.NullCache);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pricesByDate = snapshot.PriceCache[price.Symbol];
|
pricesByDate = snapshot.PriceCache[price.Symbol];
|
||||||
|
|
||||||
if (!pricesByDate.ContainsKey(price.Date))
|
if (!pricesByDate.ContainsKey(price.Date))
|
||||||
{
|
{
|
||||||
pricesByDate.Add(price.Date, price);
|
pricesByDate.Add(price.Date, price);
|
||||||
@@ -290,10 +300,47 @@ namespace MarketData.Cache
|
|||||||
public bool ContainsPrice(String symbol, DateTime date)
|
public bool ContainsPrice(String symbol, DateTime date)
|
||||||
{
|
{
|
||||||
if (!snapshot.PriceCache.ContainsKey(symbol)) return false;
|
if (!snapshot.PriceCache.ContainsKey(symbol)) return false;
|
||||||
|
|
||||||
PricesByDate pricesByDate = snapshot.PriceCache[symbol];
|
PricesByDate pricesByDate = snapshot.PriceCache[symbol];
|
||||||
return pricesByDate.ContainsKey(date);
|
return pricesByDate.ContainsKey(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearCacheOnOrBefore(DateTime onOrBeforeDate, bool collect = false)
|
||||||
|
{
|
||||||
|
lock (thisLock)
|
||||||
|
{
|
||||||
|
UpdateSnapshot(BuildEvictedPriceCache(onOrBeforeDate), snapshot.RealTimePriceCache, new Dictionary<String, bool>());
|
||||||
|
if (collect) GC.Collect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<String, PricesByDate> BuildEvictedPriceCache(DateTime onOrBeforeDate)
|
||||||
|
{
|
||||||
|
Dictionary<String, PricesByDate> newPriceCache = new Dictionary<String, PricesByDate>();
|
||||||
|
|
||||||
|
foreach (KeyValuePair<String, PricesByDate> entry in snapshot.PriceCache)
|
||||||
|
{
|
||||||
|
String symbol = entry.Key;
|
||||||
|
PricesByDate filteredPrices = new PricesByDate();
|
||||||
|
PricesByDate existingPrices = entry.Value;
|
||||||
|
|
||||||
|
foreach (KeyValuePair<DateTime, Price> kvp in existingPrices)
|
||||||
|
{
|
||||||
|
if (kvp.Key >= onOrBeforeDate)
|
||||||
|
{
|
||||||
|
filteredPrices.Add(kvp.Key, kvp.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filteredPrices.Count > 0)
|
||||||
|
{
|
||||||
|
newPriceCache.Add(symbol, filteredPrices);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return newPriceCache;
|
||||||
|
}
|
||||||
|
|
||||||
private void ThreadProc()
|
private void ThreadProc()
|
||||||
{
|
{
|
||||||
int quantums = 0;
|
int quantums = 0;
|
||||||
@@ -302,22 +349,37 @@ namespace MarketData.Cache
|
|||||||
while (threadRun)
|
while (threadRun)
|
||||||
{
|
{
|
||||||
Thread.Sleep(quantumInterval);
|
Thread.Sleep(quantumInterval);
|
||||||
if(!threadRun)break;
|
if (!threadRun) break;
|
||||||
|
|
||||||
quantums += quantumInterval;
|
quantums += quantumInterval;
|
||||||
|
|
||||||
if (quantums > cacheRefreshAfter)
|
if (quantums > cacheRefreshAfter)
|
||||||
{
|
{
|
||||||
quantums = 0;
|
quantums = 0;
|
||||||
|
|
||||||
lock (thisLock)
|
lock (thisLock)
|
||||||
{
|
{
|
||||||
UpdateSnapshot(snapshot.PriceCache, new Dictionary<String, Price>(), snapshot.NullCache);
|
DateTime maxDate = snapshot.PriceCache.Values.SelectMany(p => p.Keys).DefaultIfEmpty(DateTime.MinValue).Max();
|
||||||
|
|
||||||
|
if (maxDate != DateTime.MinValue)
|
||||||
|
{
|
||||||
|
DateTime evictBefore = dateGenerator.GenerateHistoricalDates(maxDate, EVICTION_DAYCOUNT).Min();
|
||||||
|
int beforeCount = snapshot.PriceCache.Values.Sum(p => p.Count);
|
||||||
|
Dictionary<String, PricesByDate> newCache = BuildEvictedPriceCache(evictBefore);
|
||||||
|
int afterCount = newCache.Values.Sum(p => p.Count);
|
||||||
|
int removed = beforeCount - afterCount;
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG, $"GBPriceCache eviction: removed {removed} prices (before={beforeCount}, after={afterCount}) on or before {evictBefore.ToShortDateString()}");
|
||||||
|
UpdateSnapshot(newCache, new Dictionary<String, Price>(), new Dictionary<String, bool>());
|
||||||
|
GC.Collect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateSnapshot(Dictionary<String, PricesByDate> newPriceCache,Dictionary<String, Price> newRealtimePriceCache, Dictionary<String, bool> newNullCache)
|
private void UpdateSnapshot(Dictionary<String, PricesByDate> newPriceCache, Dictionary<String, Price> newRealtimePriceCache, Dictionary<String, bool> newNullCache)
|
||||||
{
|
{
|
||||||
snapshot = new CacheSnapshot(newPriceCache, newRealtimePriceCache, newNullCache);
|
snapshot = new CacheSnapshot(newPriceCache, newRealtimePriceCache, newNullCache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1029,11 +1029,6 @@ namespace MarketData
|
|||||||
Trace.Listeners.Add(new TextWriterTraceListener(strLogFile));
|
Trace.Listeners.Add(new TextWriterTraceListener(strLogFile));
|
||||||
DateTime currentDate=DateTime.Now;
|
DateTime currentDate=DateTime.Now;
|
||||||
|
|
||||||
// CheckPricesForHoldings();
|
|
||||||
|
|
||||||
// Price price = MarketDataHelper.GetLatestPriceBigCharts("NVDA");
|
|
||||||
//List<CashflowStatement> cashflowStatements = MarketDataHelper.GetCashflowStatement("AAPL",CashflowStatement.PeriodType.Annual);
|
|
||||||
|
|
||||||
DateTime maxHolidayDate =HolidayDA.GetMaxHolidayDate();
|
DateTime maxHolidayDate =HolidayDA.GetMaxHolidayDate();
|
||||||
if(currentDate>maxHolidayDate)
|
if(currentDate>maxHolidayDate)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
CMTSESSIONv1.00
|
CMTSESSIONv1.00
|
||||||
LastUpdated=3/10/2026 9:30:20 PM
|
LastUpdated=3/12/2026 8:58:25 PM
|
||||||
TradeDate=3/10/2026
|
TradeDate=3/12/2026
|
||||||
StartDate=1/1/0001
|
StartDate=1/1/0001
|
||||||
AnalysisDate=3/10/2026
|
AnalysisDate=3/12/2026
|
||||||
CashBalance=6863.35
|
CashBalance=6863.35
|
||||||
NonTradeableCash=6456.42
|
NonTradeableCash=6456.42
|
||||||
SuspendTrading=False|UsePriceSlopeIndicator=True|UsePriceSlopeIndicatorDays=252|AnalysisDate=3/10/2026|BetaMonths=6|TradeDate=3/10/2026|MarketCapLowerLimit=500000000|SidewaysDetection=False|SidewaysAfterDays=30|PriceTrendDays=20|CheckOutliersInReturnStream=True|DailyReturnLimit=0.25|MaxDailyPositions=3|MaxOpenPositions=3|NoTradeSymbols=CODYY,MARUY,CSTM,CS,NATI,QADA,CRTO,GTBIF,CLCT,PRSC,CMD,STAY,GBTC,YOKU,PNY,RFMD,ASAZY,USMO,VNR,STB,XIV,SYNT,DFP|OnlyTradeSymbols=|MinRSI=70|InitialCash=10000|TotalRiskPercentDecimal=0.05|PositionRiskPercentDecimal=0.12|EquityOnly=False|MinPercentReturnProximityTo52WeekHigh=30|MinPercentReturnOver52WeekLow=80|ProfitMarginCheck=True|EPSCheck=True|MinDaysBetweenReholding=30|LiquidityCheck=True|MinVolume=1000|DMA200Horizon=15|MinDaysBetweenStopAdjustments=30|MinDaysBetweenInitialStopAdjustment=5|MaxPricingExceptions=3|MACDSetup=(12,26,9)|MACDSignalDays=5|MACDRejectStrongSells=True|MACDRejectWeakSells=True|UseMarketIndicator=True|Benchmark=SPY|BenchmarkMovingAverageDays=200|BenchmarkMovingAverageHorizon=5|UseMarketIndicatorVolatility=True|UseMarketIndicatorVolatilityHorizon=60|UseMarketIndicatorVolatilityBenchmark=^VIX|UseStopLimitScaling=True|StopLimitScalingType=AverageTrueRange|StopLimitScalingVolatilityDays=30|SellOnDMABreak=True|DMABreakValues=200|DMABreakForceBreak=False|EntryType=OverExtended,MVP,PriceTrend,VolumeTrend|EntryHorizon=30|CandidateExpiryDays=180|VolumeTrendDays=10|ChannelBreakoutHorizon=40|UseOverExtendedIndicatorDays=45|UseOverExtendedIndicatorViolationThreshhold=1|UseOverExtendedIndicatorMarginPercent=1|MaxBeta=10|UseMaxBeta=False|UseProfitMaximization=True|UseProfitMaximizationExpression=R_THRESSHOLD=4;MAX_ATR=3;MULTIPLIER=MAX_ATR;IF(RMultiple>=R_THRESSHOLD){MULTIPLIER=1.2;}|UseTradeOnlySectors=False|UseTradeOnlySectorsSectors=Healthcare,Technology,Basic Materials,Consumer Defensive,Industrials|EvaluateStopOnUpTrend=False
|
SuspendTrading=False|UsePriceSlopeIndicator=True|UsePriceSlopeIndicatorDays=252|AnalysisDate=3/12/2026|BetaMonths=6|TradeDate=3/12/2026|MarketCapLowerLimit=500000000|SidewaysDetection=False|SidewaysAfterDays=30|PriceTrendDays=20|CheckOutliersInReturnStream=True|DailyReturnLimit=0.25|MaxDailyPositions=3|MaxOpenPositions=3|NoTradeSymbols=CODYY,MARUY,CSTM,CS,NATI,QADA,CRTO,GTBIF,CLCT,PRSC,CMD,STAY,GBTC,YOKU,PNY,RFMD,ASAZY,USMO,VNR,STB,XIV,SYNT,DFP|OnlyTradeSymbols=|MinRSI=70|InitialCash=10000|TotalRiskPercentDecimal=0.05|PositionRiskPercentDecimal=0.12|EquityOnly=False|MinPercentReturnProximityTo52WeekHigh=30|MinPercentReturnOver52WeekLow=80|ProfitMarginCheck=True|EPSCheck=True|MinDaysBetweenReholding=30|LiquidityCheck=True|MinVolume=1000|DMA200Horizon=15|MinDaysBetweenStopAdjustments=30|MinDaysBetweenInitialStopAdjustment=5|MaxPricingExceptions=3|MACDSetup=(12,26,9)|MACDSignalDays=5|MACDRejectStrongSells=True|MACDRejectWeakSells=True|UseMarketIndicator=True|Benchmark=SPY|BenchmarkMovingAverageDays=200|BenchmarkMovingAverageHorizon=5|UseMarketIndicatorVolatility=True|UseMarketIndicatorVolatilityHorizon=60|UseMarketIndicatorVolatilityBenchmark=^VIX|UseStopLimitScaling=True|StopLimitScalingType=AverageTrueRange|StopLimitScalingVolatilityDays=30|SellOnDMABreak=True|DMABreakValues=200|DMABreakForceBreak=False|EntryType=OverExtended,MVP,PriceTrend,VolumeTrend|EntryHorizon=30|CandidateExpiryDays=180|VolumeTrendDays=10|ChannelBreakoutHorizon=40|UseOverExtendedIndicatorDays=45|UseOverExtendedIndicatorViolationThreshhold=1|UseOverExtendedIndicatorMarginPercent=1|MaxBeta=10|UseMaxBeta=False|UseProfitMaximization=True|UseProfitMaximizationExpression=R_THRESSHOLD=4;MAX_ATR=3;MULTIPLIER=MAX_ATR;IF(RMultiple>=R_THRESSHOLD){MULTIPLIER=1.2;}|UseTradeOnlySectors=False|UseTradeOnlySectorsSectors=Healthcare,Technology,Basic Materials,Consumer Defensive,Industrials|EvaluateStopOnUpTrend=False
|
||||||
PricingExceptions=0
|
PricingExceptions=0
|
||||||
TotalActivePositions=1
|
TotalActivePositions=1
|
||||||
Symbol=HWM|PurchaseDate=11/17/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=11|PurchasePrice=200.81|CurrentPrice=253.91|Exposure=2208.91|MarketValue=2793.01|GainLoss=584.1|GainLossPcnt=0.264429062297694|PositionRiskDecimal=0.12|R=24.0336|C=276.15|P=11.490163770721|InitialStopLimit=176.71|TrailingStopLimit=235.233001537323|TotalRiskExposure=264.3696|RMultiple=2.21R|Volatility=3.68232583999634|Volume=0|LastStopAdjustment=2/25/2026 12:00:00 AM|Comment=Price changed on 11/18/2025 from $200.28 to $200.81
|
Symbol=HWM|PurchaseDate=11/17/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=11|PurchasePrice=200.81|CurrentPrice=243.82|Exposure=2208.91|MarketValue=2682.02|GainLoss=473.11|GainLossPcnt=0.214182560629451|PositionRiskDecimal=0.12|R=24.0336|C=276.15|P=11.490163770721|InitialStopLimit=176.71|TrailingStopLimit=235.233001537323|TotalRiskExposure=264.3696|RMultiple=1.79R|Volatility=3.68232583999634|Volume=0|LastStopAdjustment=2/25/2026 12:00:00 AM|Comment=Price changed on 11/18/2025 from $200.28 to $200.81
|
||||||
TotalPositions=134
|
TotalPositions=134
|
||||||
Symbol=CDNS|PurchaseDate=8/25/2020 12:00:00 AM|SellDate=9/3/2020 12:00:00 AM|Shares=16|PurchasePrice=111.82|CurrentPrice=109.57|Exposure=1789.12|MarketValue=1753.12|GainLoss=-36|GainLossPcnt=-0.0201216240386335|PositionRiskDecimal=0.12|R=13.3512|C=225.6365|P=16.9000913775541|InitialStopLimit=97.9088|TrailingStopLimit=109.599856939316|TotalRiskExposure=213.6192|RMultiple=-0.17R|Volatility=2.3209912776947|Volume=1767980|LastStopAdjustment=9/2/2020 12:00:00 AM|Comment=Manual close.
|
Symbol=CDNS|PurchaseDate=8/25/2020 12:00:00 AM|SellDate=9/3/2020 12:00:00 AM|Shares=16|PurchasePrice=111.82|CurrentPrice=109.57|Exposure=1789.12|MarketValue=1753.12|GainLoss=-36|GainLossPcnt=-0.0201216240386335|PositionRiskDecimal=0.12|R=13.3512|C=225.6365|P=16.9000913775541|InitialStopLimit=97.9088|TrailingStopLimit=109.599856939316|TotalRiskExposure=213.6192|RMultiple=-0.17R|Volatility=2.3209912776947|Volume=1767980|LastStopAdjustment=9/2/2020 12:00:00 AM|Comment=Manual close.
|
||||||
Symbol=LULU|PurchaseDate=8/28/2020 12:00:00 AM|SellDate=9/4/2020 12:00:00 AM|Shares=3|PurchasePrice=377.5|CurrentPrice=370.23|Exposure=1132.5|MarketValue=1110.69|GainLoss=-21.8099999999999|GainLossPcnt=-0.0192582781456953|PositionRiskDecimal=0.12|R=45.2976|C=136.6285|P=3.01624147857723|InitialStopLimit=332.1824|TrailingStopLimit=372.562428512573|TotalRiskExposure=135.8928|RMultiple=-0.16R|Volatility=25.858959197998|Volume=2871665|LastStopAdjustment=9/2/2020 12:00:00 AM|Comment=Manual close.
|
Symbol=LULU|PurchaseDate=8/28/2020 12:00:00 AM|SellDate=9/4/2020 12:00:00 AM|Shares=3|PurchasePrice=377.5|CurrentPrice=370.23|Exposure=1132.5|MarketValue=1110.69|GainLoss=-21.8099999999999|GainLossPcnt=-0.0192582781456953|PositionRiskDecimal=0.12|R=45.2976|C=136.6285|P=3.01624147857723|InitialStopLimit=332.1824|TrailingStopLimit=372.562428512573|TotalRiskExposure=135.8928|RMultiple=-0.16R|Volatility=25.858959197998|Volume=2871665|LastStopAdjustment=9/2/2020 12:00:00 AM|Comment=Manual close.
|
||||||
@@ -162,7 +162,6 @@ Symbol=BABA|AnalysisDate=10/1/2025 12:00:00 AM|EPSSlope=0.559999942779541|Profit
|
|||||||
Symbol=ROAD|AnalysisDate=9/19/2025 12:00:00 AM|EPSSlope=0.105000019073486|ProfitMarginSlope=1.63973665237427|PriceSlope=0.00164434603625479|Volatility=4.52940130233765|Volume=0|Violation=False|Slope=0.00164434603625479|Score=0.70518000814682|AnnualizedReturn=1.51342485909754|SharpeRatio=0.167706499018902|RSquared=0.465949798503588|BetaMonths=6|Beta=1.37811621633073
|
Symbol=ROAD|AnalysisDate=9/19/2025 12:00:00 AM|EPSSlope=0.105000019073486|ProfitMarginSlope=1.63973665237427|PriceSlope=0.00164434603625479|Volatility=4.52940130233765|Volume=0|Violation=False|Slope=0.00164434603625479|Score=0.70518000814682|AnnualizedReturn=1.51342485909754|SharpeRatio=0.167706499018902|RSquared=0.465949798503588|BetaMonths=6|Beta=1.37811621633073
|
||||||
Symbol=KLAC|AnalysisDate=9/18/2025 12:00:00 AM|EPSSlope=1.4399995803833|ProfitMarginSlope=0.835277557373047|PriceSlope=0.00129829771983195|Volatility=59.6670112609863|Volume=0|Violation=False|Slope=0.00129829771983195|Score=0.696746546682062|AnnualizedReturn=1.38703867573729|SharpeRatio=-0.294672655364879|RSquared=0.502326689853622|BetaMonths=6|Beta=2.15562693702778
|
Symbol=KLAC|AnalysisDate=9/18/2025 12:00:00 AM|EPSSlope=1.4399995803833|ProfitMarginSlope=0.835277557373047|PriceSlope=0.00129829771983195|Volatility=59.6670112609863|Volume=0|Violation=False|Slope=0.00129829771983195|Score=0.696746546682062|AnnualizedReturn=1.38703867573729|SharpeRatio=-0.294672655364879|RSquared=0.502326689853622|BetaMonths=6|Beta=2.15562693702778
|
||||||
Symbol=NVMI|AnalysisDate=9/30/2025 12:00:00 AM|EPSSlope=0.365000009536743|ProfitMarginSlope=0.701305389404297|PriceSlope=0.00151116356921204|Volatility=11.0952587127686|Volume=0|Violation=False|Slope=0.00151116356921204|Score=0.634761720023267|AnnualizedReturn=1.46347423134568|SharpeRatio=-0.17068064618604|RSquared=0.433736178217226|BetaMonths=6|Beta=3.21645112867293
|
Symbol=NVMI|AnalysisDate=9/30/2025 12:00:00 AM|EPSSlope=0.365000009536743|ProfitMarginSlope=0.701305389404297|PriceSlope=0.00151116356921204|Volatility=11.0952587127686|Volume=0|Violation=False|Slope=0.00151116356921204|Score=0.634761720023267|AnnualizedReturn=1.46347423134568|SharpeRatio=-0.17068064618604|RSquared=0.433736178217226|BetaMonths=6|Beta=3.21645112867293
|
||||||
Symbol=PTCT|AnalysisDate=9/11/2025 12:00:00 AM|EPSSlope=0.229999780654907|ProfitMarginSlope=0.267559051513672|PriceSlope=0.00114877088928268|Volatility=4.3342490196228|Volume=0|Violation=False|Slope=0.00114877088928268|Score=0.606345820774638|AnnualizedReturn=1.33574643654898|SharpeRatio=0.0125861708714166|RSquared=0.453937816477493|BetaMonths=6|Beta=0.276668916101194
|
|
||||||
Symbol=LGND|AnalysisDate=9/30/2025 12:00:00 AM|EPSSlope=1.55999994277954|ProfitMarginSlope=0.261482238769531|PriceSlope=0.00131115840818318|Volatility=3.33523750305176|Volume=0|Violation=False|Slope=0.00131115840818318|Score=0.566445116927072|AnnualizedReturn=1.3915412124965|SharpeRatio=0.0375984436300414|RSquared=0.407063126726114|BetaMonths=6|Beta=0.429603430352865
|
Symbol=LGND|AnalysisDate=9/30/2025 12:00:00 AM|EPSSlope=1.55999994277954|ProfitMarginSlope=0.261482238769531|PriceSlope=0.00131115840818318|Volatility=3.33523750305176|Volume=0|Violation=False|Slope=0.00131115840818318|Score=0.566445116927072|AnnualizedReturn=1.3915412124965|SharpeRatio=0.0375984436300414|RSquared=0.407063126726114|BetaMonths=6|Beta=0.429603430352865
|
||||||
Symbol=PRIM|AnalysisDate=9/19/2025 12:00:00 AM|EPSSlope=0.315000057220459|ProfitMarginSlope=0.827674865722656|PriceSlope=0.00174915986971411|Volatility=4.4852933883667|Volume=0|Violation=False|Slope=0.00174915986971411|Score=0.560411044122823|AnnualizedReturn=1.55393168023759|SharpeRatio=0.261359856273027|RSquared=0.360640722658502|BetaMonths=6|Beta=2.63821547738842
|
Symbol=PRIM|AnalysisDate=9/19/2025 12:00:00 AM|EPSSlope=0.315000057220459|ProfitMarginSlope=0.827674865722656|PriceSlope=0.00174915986971411|Volatility=4.4852933883667|Volume=0|Violation=False|Slope=0.00174915986971411|Score=0.560411044122823|AnnualizedReturn=1.55393168023759|SharpeRatio=0.261359856273027|RSquared=0.360640722658502|BetaMonths=6|Beta=2.63821547738842
|
||||||
Symbol=BWXT|AnalysisDate=10/1/2025 12:00:00 AM|EPSSlope=0.0299999713897705|ProfitMarginSlope=0.842325210571289|PriceSlope=0.00148142098327814|Volatility=5.46874237060547|Volume=0|Violation=False|Slope=0.00148142098327814|Score=0.535519927511107|AnnualizedReturn=1.45254630359425|SharpeRatio=0.0847391180072971|RSquared=0.368676665374447|BetaMonths=6|Beta=1.20408002256826
|
Symbol=BWXT|AnalysisDate=10/1/2025 12:00:00 AM|EPSSlope=0.0299999713897705|ProfitMarginSlope=0.842325210571289|PriceSlope=0.00148142098327814|Volatility=5.46874237060547|Volume=0|Violation=False|Slope=0.00148142098327814|Score=0.535519927511107|AnnualizedReturn=1.45254630359425|SharpeRatio=0.0847391180072971|RSquared=0.368676665374447|BetaMonths=6|Beta=1.20408002256826
|
||||||
@@ -271,6 +270,7 @@ Symbol=NSSC|AnalysisDate=2/25/2026 12:00:00 AM|EPSSlope=0.0450000166893005|Profi
|
|||||||
Symbol=LPG|AnalysisDate=2/25/2026 12:00:00 AM|EPSSlope=0.299999952316284|ProfitMarginSlope=3.59709167480469|PriceSlope=0.0014348486652486|Volatility=2.03607726097107|Volume=0|Violation=False|Slope=0.0014348486652486|Score=0.646725439489726|AnnualizedReturn=1.43559854049989|SharpeRatio=-0.0995953229975915|RSquared=0.450491847995702|BetaMonths=6|Beta=1.7235174113368
|
Symbol=LPG|AnalysisDate=2/25/2026 12:00:00 AM|EPSSlope=0.299999952316284|ProfitMarginSlope=3.59709167480469|PriceSlope=0.0014348486652486|Volatility=2.03607726097107|Volume=0|Violation=False|Slope=0.0014348486652486|Score=0.646725439489726|AnnualizedReturn=1.43559854049989|SharpeRatio=-0.0995953229975915|RSquared=0.450491847995702|BetaMonths=6|Beta=1.7235174113368
|
||||||
Symbol=MPC|AnalysisDate=3/4/2026 12:00:00 AM|EPSSlope=1.98000001907349|ProfitMarginSlope=1.7620415687561|PriceSlope=0.00139964028977894|Volatility=7.6709098815918|Volume=0|Violation=False|Slope=0.00139964028977894|Score=0.906034636922709|AnnualizedReturn=1.42291751665396|SharpeRatio=-0.0262963567920841|RSquared=0.636744313228555|BetaMonths=6|Beta=3.22659752171988
|
Symbol=MPC|AnalysisDate=3/4/2026 12:00:00 AM|EPSSlope=1.98000001907349|ProfitMarginSlope=1.7620415687561|PriceSlope=0.00139964028977894|Volatility=7.6709098815918|Volume=0|Violation=False|Slope=0.00139964028977894|Score=0.906034636922709|AnnualizedReturn=1.42291751665396|SharpeRatio=-0.0262963567920841|RSquared=0.636744313228555|BetaMonths=6|Beta=3.22659752171988
|
||||||
Symbol=GPRE|AnalysisDate=3/5/2026 12:00:00 AM|EPSSlope=0.51500004529953|ProfitMarginSlope=0.921499490737915|PriceSlope=0.00507912376904452|Volatility=0.632249653339386|Volume=0|Violation=False|Slope=0.00507912376904452|Score=2.91691129240431|AnnualizedReturn=3.59642101983529|SharpeRatio=0.294963134062473|RSquared=0.811059460590603|BetaMonths=6|Beta=0.39196687303021
|
Symbol=GPRE|AnalysisDate=3/5/2026 12:00:00 AM|EPSSlope=0.51500004529953|ProfitMarginSlope=0.921499490737915|PriceSlope=0.00507912376904452|Volatility=0.632249653339386|Volume=0|Violation=False|Slope=0.00507912376904452|Score=2.91691129240431|AnnualizedReturn=3.59642101983529|SharpeRatio=0.294963134062473|RSquared=0.811059460590603|BetaMonths=6|Beta=0.39196687303021
|
||||||
|
Symbol=PSX|AnalysisDate=3/11/2026 12:00:00 AM|EPSSlope=3.57999992370605|ProfitMarginSlope=2.175705909729|PriceSlope=0.00131596457111678|Volatility=5.67953681945801|Volume=0|Violation=False|Slope=0.00131596457111678|Score=0.96795803446649|AnnualizedReturn=1.39322760292548|SharpeRatio=-0.148191340472672|RSquared=0.69475944377931|BetaMonths=6|Beta=1.36221654601515
|
||||||
TotalStopLimits=213
|
TotalStopLimits=213
|
||||||
Symbol=CDNS|AnalysisDate=9/2/2020 12:00:00 AM|PreviousStop=97.9088|NewStop=109.599856939316|CurrentPriceLow=113.59|CurrentPriceClose=117.09|PriceTrendIndicatorSlope=0.310654103755951|StopLimitId=
|
Symbol=CDNS|AnalysisDate=9/2/2020 12:00:00 AM|PreviousStop=97.9088|NewStop=109.599856939316|CurrentPriceLow=113.59|CurrentPriceClose=117.09|PriceTrendIndicatorSlope=0.310654103755951|StopLimitId=
|
||||||
Symbol=LULU|AnalysisDate=9/2/2020 12:00:00 AM|PreviousStop=332.1824|NewStop=372.562428512573|CurrentPriceLow=387.08|CurrentPriceClose=398.29|PriceTrendIndicatorSlope=2.77707505226135|StopLimitId=
|
Symbol=LULU|AnalysisDate=9/2/2020 12:00:00 AM|PreviousStop=332.1824|NewStop=372.562428512573|CurrentPriceLow=387.08|CurrentPriceClose=398.29|PriceTrendIndicatorSlope=2.77707505226135|StopLimitId=
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
MGSHSESSIONv2.00
|
MGSHSESSIONv2.00
|
||||||
LastUpdated=3/10/2026 9:29:44 PM
|
LastUpdated=3/12/2026 8:57:36 PM
|
||||||
TradeDate=3/11/2026
|
TradeDate=3/13/2026
|
||||||
StartDate=3/31/2025
|
StartDate=3/31/2025
|
||||||
AnalysisDate=3/10/2026
|
AnalysisDate=3/12/2026
|
||||||
Cycle=12
|
Cycle=12
|
||||||
CashBalance=3886.05
|
CashBalance=3886.05
|
||||||
NonTradeableCash=0
|
NonTradeableCash=0
|
||||||
HedgeCashBalance=3000
|
HedgeCashBalance=3000
|
||||||
Verbose=True|KeepSlotPositions=True|BenchmarkMode=False|BenchmarkModeSymbol=SPY|HoldingPeriod=3|MaxPositions=3|NoTradeSymbols=OSB,IBDRY,GBTC,YOKU,PNY,RFMD,ASAZY|NoTradeFinancialSymbols=U.S. Private Equity,U.S. Financials,U.S. Financial Services,U.S. Banking and Investment Services,Trading-Miscellaneous,Trading--Miscellaneous,Trading--Leveraged Equity,Trading--Leveraged Debt,Trading--Leveraged Commodities,Trading--Inverse Equity,Trading--Inverse Commodities,Tactical Allocation,Specialty Finance,Japan Financials,Savings & Cooperative Banks,Option Writing,Insurance Brokers,Insurance - Specialty,Insurance - Reinsurance,Insurance - Property & Casualty,Insurance - Life,Insurance - Diversified,Global Private Equity,Global Financials,Financial Services,Financial Exchanges,Financial,China Financials,Banks - Regional - US,Banks - Regional - Latin America,Banks - Global,Asset Management,Credit Services|Benchmark=SPY|MarketCapLowerLimit=1000000000|UsePEScreen=False|UseEBITDAScreen=True|UseRevenuePerShareScreen=True|UseLowSlopeBetaCheck=True|LowSlopeBetaDays=15|LowSlopeBetaThreshhold=1|UseMACD=True|MACDSetup=(12,26,9)|MACDSignalDays=12|MACDRejectStrongSellSignals=False|MACDRejectWeakSellSignals=True|UseStochastics=True|StochasticsSignalDays=3|StochasticsRejectStrongSells=True|StochasticsRejectWeakSells=True|UseFallbackCandidate=True|FallbackCandidate=SHV|FallbackCandidateBestOf=SHV,NEAR,BIL,GSY,AGG,ACWX,GSY,SCHF,IXUS,DBEF,IEFA,TLT|UseMaxPEScreen=True|MaxPE=40|StrictMaxPE=False|QualityIndicatorType=IDINDICATOR|IncludeTradeMasterForSymbolsHeld=True|UseStopLimits=True|StopLimitRiskPercentDecimal=0.2|StopLimitScalingVolatilityDays=30|MinDaysBetweenInitialStopAdjustment=30|MinDaysBetweenStopAdjustments=30|StopLimitPriceTrendDays=20|StopLimitATRMultiplier=3|UseHedging=True|HedgeBenchmarkSymbol=SPY|HedgeShortSymbol=SH|HedgeRiskPercentDecimal=0.12|HedgeMinDaysBetweenStopAdjustments=1|HedgeInitialCash=3000|HedgeCloseAboveSMANDays=10|HedgeBandBreakCheckDays=3|HedgeATRMultiplier=1|MaxPricingExceptions=3|UseBetaGenerator=True|UseBetaGeneratorMonths=24
|
Verbose=True|KeepSlotPositions=True|BenchmarkMode=False|BenchmarkModeSymbol=SPY|HoldingPeriod=3|MaxPositions=3|NoTradeSymbols=OSB,IBDRY,GBTC,YOKU,PNY,RFMD,ASAZY|NoTradeFinancialSymbols=U.S. Private Equity,U.S. Financials,U.S. Financial Services,U.S. Banking and Investment Services,Trading-Miscellaneous,Trading--Miscellaneous,Trading--Leveraged Equity,Trading--Leveraged Debt,Trading--Leveraged Commodities,Trading--Inverse Equity,Trading--Inverse Commodities,Tactical Allocation,Specialty Finance,Japan Financials,Savings & Cooperative Banks,Option Writing,Insurance Brokers,Insurance - Specialty,Insurance - Reinsurance,Insurance - Property & Casualty,Insurance - Life,Insurance - Diversified,Global Private Equity,Global Financials,Financial Services,Financial Exchanges,Financial,China Financials,Banks - Regional - US,Banks - Regional - Latin America,Banks - Global,Asset Management,Credit Services|Benchmark=SPY|MarketCapLowerLimit=1000000000|UsePEScreen=False|UseEBITDAScreen=True|UseRevenuePerShareScreen=True|UseLowSlopeBetaCheck=True|LowSlopeBetaDays=15|LowSlopeBetaThreshhold=1|UseMACD=True|MACDSetup=(12,26,9)|MACDSignalDays=12|MACDRejectStrongSellSignals=False|MACDRejectWeakSellSignals=True|UseStochastics=True|StochasticsSignalDays=3|StochasticsRejectStrongSells=True|StochasticsRejectWeakSells=True|UseFallbackCandidate=True|FallbackCandidate=SHV|FallbackCandidateBestOf=SHV,NEAR,BIL,GSY,AGG,ACWX,GSY,SCHF,IXUS,DBEF,IEFA,TLT|UseMaxPEScreen=True|MaxPE=40|StrictMaxPE=False|QualityIndicatorType=IDINDICATOR|IncludeTradeMasterForSymbolsHeld=True|UseStopLimits=True|StopLimitRiskPercentDecimal=0.2|StopLimitScalingVolatilityDays=30|MinDaysBetweenInitialStopAdjustment=30|MinDaysBetweenStopAdjustments=30|StopLimitPriceTrendDays=20|StopLimitATRMultiplier=3|UseHedging=True|HedgeBenchmarkSymbol=SPY|HedgeShortSymbol=SH|HedgeRiskPercentDecimal=0.12|HedgeMinDaysBetweenStopAdjustments=1|HedgeInitialCash=3000|HedgeCloseAboveSMANDays=10|HedgeBandBreakCheckDays=3|HedgeATRMultiplier=1|MaxPricingExceptions=3|UseBetaGenerator=True|UseBetaGeneratorMonths=24
|
||||||
TotalActivePositions=6
|
TotalActivePositions=6
|
||||||
Slot=0|Symbol=CAH|PurchaseDate=9/30/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=5|PurchasePrice=155.81|CurrentPrice=217.04|Volume=2414935|Return1D=0|CumReturn252=0|IDIndicator=-17.9282868525896|Score=1.45705377610136|Velocity=0.779428953080648|PE=23.64|Beta=0.628226122785001|InitialStopLimit=124.65|TrailingStopLimit=210.485930538177|LastStopAdjustment=3/2/2026 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=31.392|Comment=Price changed on 10/1/2025 from $156.96 to $155.81
|
Slot=0|Symbol=CAH|PurchaseDate=9/30/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=5|PurchasePrice=155.81|CurrentPrice=219.09|Volume=2414935|Return1D=0|CumReturn252=0|IDIndicator=-17.9282868525896|Score=1.45705377610136|Velocity=0.779428953080648|PE=23.64|Beta=0.628226122785001|InitialStopLimit=124.65|TrailingStopLimit=210.485930538177|LastStopAdjustment=3/2/2026 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=31.392|Comment=Price changed on 10/1/2025 from $156.96 to $155.81
|
||||||
Slot=1|Symbol=XEL|PurchaseDate=10/31/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=5|PurchasePrice=81.17|CurrentPrice=81.88|Volume=6202750|Return1D=0|CumReturn252=0|IDIndicator=-11.5537848605578|Score=0.602697377681549|Velocity=0.944803580308304|PE=22.43|Beta=-0.192317961128493|InitialStopLimit=64.936|TrailingStopLimit=77.5441425132751|LastStopAdjustment=2/23/2026 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=16.234|Comment=
|
Slot=1|Symbol=XEL|PurchaseDate=10/31/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=5|PurchasePrice=81.17|CurrentPrice=80.82|Volume=6202750|Return1D=0|CumReturn252=0|IDIndicator=-11.5537848605578|Score=0.602697377681549|Velocity=0.944803580308304|PE=22.43|Beta=-0.192317961128493|InitialStopLimit=64.936|TrailingStopLimit=77.5441425132751|LastStopAdjustment=2/23/2026 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=16.234|Comment=
|
||||||
Slot=1|Symbol=MDT|PurchaseDate=1/30/2026 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=14|PurchasePrice=102.85|CurrentPrice=89.89|Volume=6046285|Return1D=0|CumReturn252=0|IDIndicator=-10.3585657370518|Score=0.518428403011861|Velocity=0.865293185419968|PE=26.67|Beta=0.37428296833055|InitialStopLimit=82.28|TrailingStopLimit=82.28|LastStopAdjustment=1/1/0001 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=20.592|Comment=Price changed on 2/2/2026 from $102.96 to $102.85
|
Slot=1|Symbol=MDT|PurchaseDate=1/30/2026 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=14|PurchasePrice=102.85|CurrentPrice=87.38|Volume=6046285|Return1D=0|CumReturn252=0|IDIndicator=-10.3585657370518|Score=0.518428403011861|Velocity=0.865293185419968|PE=26.67|Beta=0.37428296833055|InitialStopLimit=82.28|TrailingStopLimit=82.28|LastStopAdjustment=1/1/0001 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=20.592|Comment=Price changed on 2/2/2026 from $102.96 to $102.85
|
||||||
Slot=2|Symbol=NFG|PurchaseDate=11/28/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=12|PurchasePrice=82.45|CurrentPrice=91.17|Volume=236813|Return1D=0|CumReturn252=0|IDIndicator=-9.56175298804781|Score=1.47874375251707|Velocity=0.658599827139153|PE=31.63|Beta=0.0443025382529758|InitialStopLimit=65.96|TrailingStopLimit=85.4851430559158|LastStopAdjustment=3/2/2026 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=16.49|Comment=
|
Slot=2|Symbol=NFG|PurchaseDate=11/28/2025 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=12|PurchasePrice=82.45|CurrentPrice=93.74|Volume=236813|Return1D=0|CumReturn252=0|IDIndicator=-9.56175298804781|Score=1.47874375251707|Velocity=0.658599827139153|PE=31.63|Beta=0.0443025382529758|InitialStopLimit=65.96|TrailingStopLimit=85.4851430559158|LastStopAdjustment=3/2/2026 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=16.49|Comment=
|
||||||
Slot=2|Symbol=NWN|PurchaseDate=2/27/2026 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=18|PurchasePrice=53|CurrentPrice=51.62|Volume=468654|Return1D=0|CumReturn252=0|IDIndicator=-17.1314741035857|Score=0.661596031246807|Velocity=1|PE=20.04|Beta=-0.0208556368428403|InitialStopLimit=42.4|TrailingStopLimit=42.4|LastStopAdjustment=1/1/0001 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=10.608|Comment=Price changed on 3/2/2026 from $53.04 to $53.00
|
Slot=2|Symbol=NWN|PurchaseDate=2/27/2026 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=18|PurchasePrice=53|CurrentPrice=51.94|Volume=468654|Return1D=0|CumReturn252=0|IDIndicator=-17.1314741035857|Score=0.661596031246807|Velocity=1|PE=20.04|Beta=-0.0208556368428403|InitialStopLimit=42.4|TrailingStopLimit=42.4|LastStopAdjustment=1/1/0001 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=10.608|Comment=Price changed on 3/2/2026 from $53.04 to $53.00
|
||||||
Slot=2|Symbol=ALLE|PurchaseDate=2/27/2026 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=6|PurchasePrice=160.87|CurrentPrice=147.53|Volume=483322|Return1D=0|CumReturn252=0|IDIndicator=-7.56972111553785|Score=1.09215924523576|Velocity=0.659949622166247|PE=24.3|Beta=0.326218892554503|InitialStopLimit=128.7|TrailingStopLimit=128.7|LastStopAdjustment=1/1/0001 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=32.23|Comment=Price changed on 3/2/2026 from $161.15 to $160.87
|
Slot=2|Symbol=ALLE|PurchaseDate=2/27/2026 12:00:00 AM|SellDate=1/1/0001 12:00:00 AM|Shares=6|PurchasePrice=160.87|CurrentPrice=145.85|Volume=483322|Return1D=0|CumReturn252=0|IDIndicator=-7.56972111553785|Score=1.09215924523576|Velocity=0.659949622166247|PE=24.3|Beta=0.326218892554503|InitialStopLimit=128.7|TrailingStopLimit=128.7|LastStopAdjustment=1/1/0001 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=32.23|Comment=Price changed on 3/2/2026 from $161.15 to $160.87
|
||||||
TotalPositions=20
|
TotalPositions=20
|
||||||
Symbol=MO|PurchaseDate=3/31/2025 12:00:00 AM|SellDate=5/14/2025 12:00:00 AM|Shares=18|PurchasePrice=59.91|CurrentPrice=56.15|Volume=17335180|Return1D=0|CumReturn252=0|IDIndicator=-15.9362549800797|Score=1.14749269300042|Velocity=0.967136150234742|PE=9|Beta=0.572465642401382|InitialStopLimit=47.93|TrailingStopLimit=56.1565003347397|LastStopAdjustment=5/7/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=12.004|Comment=Closed due to trailing stop.
|
Symbol=MO|PurchaseDate=3/31/2025 12:00:00 AM|SellDate=5/14/2025 12:00:00 AM|Shares=18|PurchasePrice=59.91|CurrentPrice=56.15|Volume=17335180|Return1D=0|CumReturn252=0|IDIndicator=-15.9362549800797|Score=1.14749269300042|Velocity=0.967136150234742|PE=9|Beta=0.572465642401382|InitialStopLimit=47.93|TrailingStopLimit=56.1565003347397|LastStopAdjustment=5/7/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=12.004|Comment=Closed due to trailing stop.
|
||||||
Symbol=EXC|PurchaseDate=3/31/2025 12:00:00 AM|SellDate=5/14/2025 12:00:00 AM|Shares=24|PurchasePrice=45.76|CurrentPrice=42.6|Volume=14993121|Return1D=0|CumReturn252=0|IDIndicator=-8.76494023904382|Score=0.405636492837393|Velocity=1|PE=18.02|Beta=0.248374476251328|InitialStopLimit=36.61|TrailingStopLimit=42.7107857322693|LastStopAdjustment=4/30/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=9.216|Comment=Closed due to trailing stop.
|
Symbol=EXC|PurchaseDate=3/31/2025 12:00:00 AM|SellDate=5/14/2025 12:00:00 AM|Shares=24|PurchasePrice=45.76|CurrentPrice=42.6|Volume=14993121|Return1D=0|CumReturn252=0|IDIndicator=-8.76494023904382|Score=0.405636492837393|Velocity=1|PE=18.02|Beta=0.248374476251328|InitialStopLimit=36.61|TrailingStopLimit=42.7107857322693|LastStopAdjustment=4/30/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=9.216|Comment=Closed due to trailing stop.
|
||||||
|
|||||||
Reference in New Issue
Block a user