Fix ImageHelper not rendering images due to issue in PointMapping.
Some checks failed
Build .NET Project / build (push) Has been cancelled
Some checks failed
Build .NET Project / build (push) Has been cancelled
This commit is contained in:
@@ -191,10 +191,12 @@ namespace MarketData.CNNProcessing
|
||||
if(null==NoiseArray)NoiseArray=new double[]{0.00};
|
||||
if(testCase.TypeGenerate.Equals(TestCase.GenerateType.BollingerBand))
|
||||
{
|
||||
testCase.PathFileNames.Add(CreateFileName("T",testCase.Symbol,testCase.DayCount,0,0,0,TestCase.CaseType.Test,TestCase.GenerateType.BollingerBand,testCase.PurchaseDate));
|
||||
ProcessBollingerBandData(testCase,PenWidthArray[0],NoiseArray[0]);
|
||||
}
|
||||
else if(testCase.TypeGenerate.Equals(TestCase.GenerateType.BollingerBandWithVIX))
|
||||
{
|
||||
testCase.PathFileNames.Add(CreateFileName("T",testCase.Symbol,testCase.DayCount,0,0,0,TestCase.CaseType.Test,TestCase.GenerateType.BollingerBandWithVIX,testCase.PurchaseDate));
|
||||
ProcessBollingerBandDataWithVolatility(testCase,PenWidthArray[0],NoiseArray[0]);
|
||||
}
|
||||
}
|
||||
@@ -243,35 +245,14 @@ namespace MarketData.CNNProcessing
|
||||
imageHelper.CreateImage(Width,Height,pointMapping);
|
||||
imageHelper.Fill(FillBrush);
|
||||
|
||||
LineSegments lineSegments=new LineSegments();
|
||||
for(int index=0;index<close.Length && DrawPrice;index++)
|
||||
{
|
||||
if(0==index)continue;
|
||||
SKPoint p1=new SKPoint(index-1,(int)close[index-1]);
|
||||
SKPoint p2=new SKPoint(index,(int)close[index]);
|
||||
lineSegments.Add(p1,p2);
|
||||
}
|
||||
imageHelper.DrawPath(DrawingBrush,penWidth,lineSegments);
|
||||
// draw price
|
||||
if(DrawPrice)imageHelper.DrawSeries(DrawingBrushRed,penWidth,close);
|
||||
|
||||
lineSegments.Clear();
|
||||
for(int index=0;index<k.Length;index++)
|
||||
{
|
||||
if(0==index)continue;
|
||||
SKPoint p1=new SKPoint(index-1,(int)k[index-1]);
|
||||
SKPoint p2=new SKPoint(index,(int)k[index]);
|
||||
lineSegments.Add(p1,p2);
|
||||
}
|
||||
imageHelper.DrawPath(DrawingBrush,penWidth,lineSegments);
|
||||
// draw k
|
||||
imageHelper.DrawSeries(DrawingBrushRed,penWidth,k);
|
||||
|
||||
lineSegments.Clear();
|
||||
for(int index=0;index<l.Length;index++)
|
||||
{
|
||||
if(0==index)continue;
|
||||
SKPoint p1=new SKPoint(index-1,(int)l[index-1]);
|
||||
SKPoint p2=new SKPoint(index,(int)l[index]);
|
||||
lineSegments.Add(p1,p2);
|
||||
}
|
||||
imageHelper.DrawPath(DrawingBrush,penWidth,lineSegments);
|
||||
// draw l
|
||||
imageHelper.DrawSeries(DrawingBrushRed,penWidth,l);
|
||||
|
||||
if(0.00!=noise)imageHelper.AddNoise(NoiseColor,noise);
|
||||
|
||||
@@ -349,48 +330,17 @@ namespace MarketData.CNNProcessing
|
||||
imageHelper.CreateImage(Width,Height,pointMapping);
|
||||
imageHelper.Fill(FillBrush);
|
||||
|
||||
LineSegments lineSegments=new LineSegments();
|
||||
// draw volatility
|
||||
for(int index=0;index<v.Length;index++)
|
||||
{
|
||||
if(0==index)continue;
|
||||
SKPoint p1=new SKPoint(index-1,(int)v[index-1]);
|
||||
SKPoint p2=new SKPoint(index,(int)v[index]);
|
||||
lineSegments.Add(p1,p2);
|
||||
}
|
||||
imageHelper.DrawPath(DrawingBrushRed,penWidth,lineSegments);
|
||||
imageHelper.DrawSeries(DrawingBrushRed,penWidth,v);
|
||||
|
||||
// draw prices
|
||||
lineSegments.Clear();
|
||||
for(int index=0;index<close.Length && DrawPrice;index++)
|
||||
{
|
||||
if(0==index)continue;
|
||||
SKPoint p1=new SKPoint(index-1,(int)close[index-1]);
|
||||
SKPoint p2=new SKPoint(index,(int)close[index]);
|
||||
lineSegments.Add(p1,p2);
|
||||
}
|
||||
imageHelper.DrawPath(DrawingBrush,penWidth,lineSegments);
|
||||
if(DrawPrice)imageHelper.DrawSeries(DrawingBrush,penWidth,close);
|
||||
|
||||
// draw k
|
||||
lineSegments.Clear();
|
||||
for(int index=0;index<k.Length;index++)
|
||||
{
|
||||
if(0==index)continue;
|
||||
SKPoint p1=new SKPoint(index-1,(int)k[index-1]);
|
||||
SKPoint p2=new SKPoint(index,(int)k[index]);
|
||||
lineSegments.Add(p1,p2);
|
||||
}
|
||||
imageHelper.DrawPath(DrawingBrush,penWidth,lineSegments);
|
||||
imageHelper.DrawSeries(DrawingBrush,penWidth,k);
|
||||
|
||||
// draw l
|
||||
lineSegments.Clear();
|
||||
for(int index=0;index<l.Length;index++)
|
||||
{
|
||||
if(0==index)continue;
|
||||
SKPoint p1=new SKPoint(index-1,(int)l[index-1]);
|
||||
SKPoint p2=new SKPoint(index,(int)l[index]);
|
||||
lineSegments.Add(p1,p2);
|
||||
}
|
||||
imageHelper.DrawPath(DrawingBrush,penWidth,lineSegments);
|
||||
imageHelper.DrawSeries(DrawingBrush,penWidth,l);
|
||||
|
||||
if(0.00!=noise)imageHelper.AddNoise(NoiseColor,noise);
|
||||
if(testCase.TypeOutput.Equals(TestCase.OutputType.OutputFile))
|
||||
|
||||
Reference in New Issue
Block a user