Add Green to BollingerBandWithVIX and add additional pen widths

This commit is contained in:
2026-03-12 21:19:36 -04:00
parent fcadf5438a
commit d85a46ba19
2 changed files with 17 additions and 11 deletions

View File

@@ -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

View File

@@ -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());
} }
} }