vertical guide
This commit is contained in:
parent
78524ae2d0
commit
077c1d21fc
|
|
@ -57,4 +57,45 @@ public static class Confirmations
|
|||
|
||||
return HeightIncrement;
|
||||
}
|
||||
|
||||
public static List<decimal> GetResistanceLeevls(List<TAReport> reports, float tolerance = 0.1f, int steps = 5){
|
||||
List<decimal> allResistances = new List<decimal>();
|
||||
|
||||
decimal highest = 0;
|
||||
decimal lowest = 1000000000000000;
|
||||
|
||||
int lastMACross = 0;
|
||||
for(int k =0; k < reports.Count; k++){
|
||||
if(highest < reports[k].High){
|
||||
highest = reports[k].High;
|
||||
}
|
||||
|
||||
if(lowest > reports[k].Low){
|
||||
lowest = reports[k].Low;
|
||||
}
|
||||
|
||||
if(k <steps * 3){continue;} //not enough history
|
||||
|
||||
bool MATopNow = reports[k].SMA20 > reports[k].High;
|
||||
bool MATopBefore = reports[k-1].SMA20 > reports[k-1].High;
|
||||
|
||||
bool MACrossed = MATopBefore!=MATopNow;
|
||||
if(!MACrossed){continue;}//No cross
|
||||
if(lastMACross == 0){
|
||||
lastMACross = k;
|
||||
continue; //First Cross
|
||||
}
|
||||
|
||||
//Get lowest point between this and last cross
|
||||
decimal lowestInPeriod = 1000000;
|
||||
for(int i=k; i < lastMACross; i++ ){
|
||||
if(reports[i].Low < lowestInPeriod){
|
||||
lowestInPeriod=reports[i].Low;
|
||||
}
|
||||
}
|
||||
allResistances.Add(lowestInPeriod);
|
||||
}
|
||||
|
||||
return allResistances;
|
||||
}
|
||||
}
|
||||
|
|
@ -78,6 +78,9 @@ public class Picasso{
|
|||
PointF[] TWSPoints = bottomPoints;
|
||||
TWSPoints[1]-= new PointF(0,TWSHeightIncrement);
|
||||
img.Mutate(ctx=>ctx.DrawLine(TWSColor, 10, TWSPoints));
|
||||
|
||||
img.Mutate(ctx=>ctx.DrawLine(Color.DarkGrey , 0.5f, [new PointF(i * widthMultiplier, 0),new PointF(i * widthMultiplier, height)])); //Draw Vertical guide
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region TBC
|
||||
|
|
@ -93,6 +96,8 @@ public class Picasso{
|
|||
PointF[] TBCPoints = topPoints;
|
||||
TBCPoints[1]+= new PointF(0,TBCHeightIncremenet);
|
||||
img.Mutate(ctx=>ctx.DrawLine(TBCColor, 10, TBCPoints));
|
||||
|
||||
img.Mutate(ctx=>ctx.DrawLine(Color.DarkGrey , 0.5f, [new PointF(i * widthMultiplier, 0),new PointF(i * widthMultiplier, height)])); //Draw Vertical guide
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user