vwap long signal

This commit is contained in:
Sewmina 2025-03-18 15:17:52 +05:30
parent 05024836b6
commit 3d5fc5586e
4 changed files with 82 additions and 8 deletions

View File

@ -154,7 +154,8 @@ namespace SignalsTest
reports[i].isBullFlag = Confirmations.IsBullFlag(reports, i); reports[i].isBullFlag = Confirmations.IsBullFlag(reports, i);
reports[i].RelativeVolumeIndex = Confirmations.GetRelativeVolumeIndex(reports,i); reports[i].RelativeVolumeIndex = Confirmations.GetRelativeVolumeIndex(reports,i);
reports[i].isVwapSignal = Patterns.isVwapThing1(reports, i); reports[i].isVwapShort = Patterns.isVwapShort(reports, i);
reports[i].isVwapLong = Patterns.isVwapLong(reports,i);
} }
Console.WriteLine($"Drawing chart for {reports.Count} candles, Coin: {symbol}, ceil:{max}, floor:{min}"); Console.WriteLine($"Drawing chart for {reports.Count} candles, Coin: {symbol}, ceil:{max}, floor:{min}");
@ -205,8 +206,11 @@ namespace SignalsTest
// triggers+=$"Possible Bull Flag\n"; // triggers+=$"Possible Bull Flag\n";
// } // }
if(reports[reports.Count-1].isVwapSignal){ if(reports[reports.Count-1].isVwapShort){
triggers+=$"VWAP Signal\n"; triggers+=$"VWAP Short Signal\n";
}
if(reports[reports.Count-1].isVwapLong){
triggers+=$"VWAP Long Signal\n";
} }
if (triggers != "") if (triggers != "")
{ {

View File

@ -204,7 +204,7 @@ public static class Patterns{
} }
public static bool isVwapThing1(List<TAReport> responses, int index, int length = 10){ public static bool isVwapShort(List<TAReport> responses, int index, int length = 10){
if(index < length * 2){ if(index < length * 2){
return false; return false;
} }
@ -259,7 +259,66 @@ public static class Patterns{
bool final = isRed && isSolid && isBelowVwap && beenAcrossVwap && mostlyGreen; bool final = isRed && isSolid && isBelowVwap && beenAcrossVwap && mostlyGreen;
if(final){ if(final){
Console.WriteLine($"Vwap signal on {curReport.pair}({curReport.interval}m) : {highCount} / {lowCount} = {highCount/lowCount} , {candlesSinceLastHigh} last High"); Console.WriteLine($"Vwap(S) signal on {curReport.pair}({curReport.interval}m) : {highCount} / {lowCount} = {highCount/lowCount} , {candlesSinceLastHigh} last High");
}
return final;
}
public static bool isVwapLong (List<TAReport> responses, int index, int length = 10){
if(index < length * 2){
return false;
}
float lowCount =0;
float highCount =0;
decimal hh= 0;
decimal ll = 10000000000;
float avgSize = 0;
int candlesSinceLastHigh = 0;
int greenCandlesAmount =0;
for(int i=index; i > index-length; i--){
candlesSinceLastHigh++;
if(responses[i].RSI50 > 50){
greenCandlesAmount++;
}
if(responses[i].candle.High > responses[i].VwapWeekly){
candlesSinceLastHigh=0;
highCount++;
if(hh < responses[i].High){
hh = responses[i].High;
}
}else if(responses[i].candle.Low < responses[i].VwapWeekly){
lowCount++;
if(ll > responses[i].Low){
ll = responses[i].Low;
}
}
avgSize += responses[i].candle.getCandleLength();
}
avgSize /= length;
TAReport curReport = responses[index];
bool isAboveVwap = curReport.Open > curReport.VwapWeekly || curReport.Close > curReport.VwapWeekly;
bool isSolid = IsSolid(curReport.candle) ;
bool isGreen = curReport.RSI50 >= 50;
bool beenAcrossVwap = (highCount / lowCount) > 0;
bool mostylRed = greenCandlesAmount < length /3f;
//These did not matter
bool closeToVwap = curReport.Open < hh && curReport.Open > ll;
bool mostlyBelowVwap = (highCount / lowCount) < 0.3f;
bool crossedRecently = candlesSinceLastHigh < (length/3);
bool isLarge = curReport.candle.getCandleLength() > avgSize;
bool final = isGreen && isSolid && isAboveVwap && beenAcrossVwap && mostylRed;
if(final){
Console.WriteLine($"Vwap(L) signal on {curReport.pair}({curReport.interval}m) : {highCount} / {lowCount} = {highCount/lowCount} , {candlesSinceLastHigh} last High");
} }
return final; return final;
} }

View File

@ -123,9 +123,9 @@ public class Picasso{
#endregion #endregion
#region VWAP #region VWAP
if(reports[i].isVwapSignal){ if(reports[i].isVwapShort){
string text = $"VWAP"; string text = $"VW(S)";
// Position text below the candle // Position text below the candle
PointF textPosition = new PointF(i * widthMultiplier - 15, lowVal + 20); PointF textPosition = new PointF(i * widthMultiplier - 15, lowVal + 20);
@ -133,6 +133,15 @@ public class Picasso{
img.Mutate(ctx => ctx.DrawText(text, indicatorFont, Color.Green, textPosition)); img.Mutate(ctx => ctx.DrawText(text, indicatorFont, Color.Green, textPosition));
img.Mutate(ctx=>ctx.DrawLine(Color.DarkRed, 0.5f, [new PointF(i * widthMultiplier, 0), new PointF(i * widthMultiplier, height)])); //Draw Vertical guide img.Mutate(ctx=>ctx.DrawLine(Color.DarkRed, 0.5f, [new PointF(i * widthMultiplier, 0), new PointF(i * widthMultiplier, height)])); //Draw Vertical guide
} }
if(reports[i].isVwapLong){
string text = $"VW(L)";
// Position text below the candle
PointF textPosition = new PointF(i * widthMultiplier - 15, lowVal + 20);
img.Mutate(ctx => ctx.DrawText(text, indicatorFont, Color.Green, textPosition));
img.Mutate(ctx=>ctx.DrawLine(Color.DarkGreen, 0.5f, [new PointF(i * widthMultiplier, 0), new PointF(i * widthMultiplier, height)]));
}
#endregion #endregion
#region TBC #region TBC

View File

@ -54,7 +54,9 @@ namespace SignalsTest
public decimal Stochastic = 0; public decimal Stochastic = 0;
public decimal StochasticK3 = 0; public decimal StochasticK3 = 0;
public float RelativeVolumeIndex = 0; public float RelativeVolumeIndex = 0;
public bool isVwapSignal = false; public bool isVwapShort = false;
public bool isVwapLong = false;
public bool STUp = false; public bool STUp = false;
public bool TGOR=false; public bool TGOR=false;
public static TAReport Generate(string _pair, int _interval, List<KlineCandleStickResponse> response, int index, List<TAReport> history) public static TAReport Generate(string _pair, int _interval, List<KlineCandleStickResponse> response, int index, List<TAReport> history)