Hammer patterns
This commit is contained in:
parent
22e80da4a5
commit
3219c51be3
10
CoinWatch.cs
10
CoinWatch.cs
|
|
@ -180,11 +180,17 @@ namespace SignalsTest
|
|||
|
||||
if (reports[reports.Count - 2].TWS > 1)
|
||||
{
|
||||
triggers += $"Three White Soldiers appeared";
|
||||
triggers += $"Three White Soldiers appeared\n";
|
||||
}
|
||||
if (reports[reports.Count - 2].TBC > 1)
|
||||
{
|
||||
triggers += $"Three Black Crows appeared";
|
||||
triggers += $"Three Black Crows appeared\n";
|
||||
}
|
||||
if(reports[reports.Count-2].isHammer){
|
||||
triggers+=$"Hammer candle appeared\n";
|
||||
}
|
||||
if(reports[reports.Count-2].isInverseHammer){
|
||||
triggers+=$"Inverse Hammer candle appeared\n";
|
||||
}
|
||||
|
||||
if (triggers != "")
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ public static class Confirmations
|
|||
return TWSHeightIncrement;
|
||||
}
|
||||
|
||||
public static float GetTBCConfirmation(List<TAReport> reports, int i)
|
||||
public static int GetTBCConfirmation(List<TAReport> reports, int i)
|
||||
{
|
||||
float HeightIncrement = 0;
|
||||
int HeightIncrement = 0;
|
||||
|
||||
if (i > 22)
|
||||
{
|
||||
|
|
@ -51,8 +51,8 @@ public static class Confirmations
|
|||
}
|
||||
}
|
||||
|
||||
if (hasCrossedMA) HeightIncrement += 15;
|
||||
if (hasCrossedST) HeightIncrement += 15;
|
||||
if (hasCrossedMA) HeightIncrement += 1;
|
||||
if (hasCrossedST) HeightIncrement += 1;
|
||||
}
|
||||
|
||||
return HeightIncrement;
|
||||
|
|
|
|||
14
Picasso.cs
14
Picasso.cs
|
|
@ -107,7 +107,8 @@ public class Picasso{
|
|||
}
|
||||
float TWSHeightIncrement = Confirmations.GetTWSConfirmation(reports,i);
|
||||
|
||||
string strengthText = reports[i].TWS == 3 ? "+2" : "+1";
|
||||
string strengthText = $"+{TWSHeightIncrement}";
|
||||
if(TWSHeightIncrement==0){strengthText="";}
|
||||
string text = $"TWS{strengthText}";
|
||||
|
||||
// Position text below the candle
|
||||
|
|
@ -128,7 +129,8 @@ public class Picasso{
|
|||
}
|
||||
float TWSHeightIncrement = Confirmations.GetTBCConfirmation(reports,i);
|
||||
|
||||
string strengthText = reports[i].TBC == 3 ? "+2" : "+1";
|
||||
string strengthText = $"+{TWSHeightIncrement}";
|
||||
if(TWSHeightIncrement==0){strengthText="";}
|
||||
string text = $"TBC{strengthText}";
|
||||
|
||||
// Position text above the candle
|
||||
|
|
@ -140,17 +142,17 @@ public class Picasso{
|
|||
#endregion
|
||||
|
||||
// Update hammer indicator position
|
||||
if (Patterns.isHammer(reports[i].candle))
|
||||
if (reports[i].isHammer)
|
||||
{
|
||||
float squareSize = 10f;
|
||||
float squareSize = 3f;
|
||||
PointF squarePosition = new PointF(i * widthMultiplier - squareSize/2, lowVal - 40);
|
||||
img.Mutate(ctx => ctx.Fill(Color.White, new RectangleF(squarePosition, new SizeF(squareSize, squareSize))));
|
||||
}
|
||||
|
||||
// Update inverse hammer indicator position
|
||||
if (Patterns.isInverseHammer(reports[i].candle))
|
||||
if (reports[i].isInverseHammer)
|
||||
{
|
||||
float squareSize = 10f;
|
||||
float squareSize = 3f;
|
||||
PointF squarePosition = new PointF(i * widthMultiplier - squareSize/2, highVal + 50);
|
||||
img.Mutate(ctx => ctx.Fill(Color.White, new RectangleF(squarePosition, new SizeF(squareSize, squareSize))));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ namespace SignalsTest
|
|||
public int TWS =0;
|
||||
public int TBC = 0;
|
||||
|
||||
public bool isHammer,isInverseHammer = false;
|
||||
|
||||
public decimal Stochastic = 0;
|
||||
public decimal StochasticK3 = 0;
|
||||
|
||||
|
|
@ -149,7 +151,8 @@ namespace SignalsTest
|
|||
report.TWS = Patterns.GetThreeWhiteSoldiers(response,index);
|
||||
report.TBC = Patterns.GetThreeBlackCrows(response, index);
|
||||
|
||||
|
||||
report.isHammer = Patterns.isHammer(response[index]);
|
||||
report.isInverseHammer = Patterns.isInverseHammer(response[index]);
|
||||
return report;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user