Update tg message for synthapi
This commit is contained in:
@@ -38,14 +38,20 @@ public class MacdCrossIndicator : Indicator
|
||||
var previousCandle = macdCandle[0];
|
||||
foreach (var currentCandle in macdCandle.Skip(1))
|
||||
{
|
||||
if (previousCandle.Histogram > 0 && currentCandle.Histogram < 0 && currentCandle.Macd < 0)
|
||||
// Only trigger signals when Signal line is outside -100 to 100 range (extreme conditions)
|
||||
if (currentCandle.Signal < -200 || currentCandle.Signal > 200)
|
||||
{
|
||||
AddSignal(currentCandle, TradeDirection.Short, Confidence.Medium);
|
||||
}
|
||||
// Check for MACD line crossing below Signal line (bearish cross)
|
||||
if (previousCandle.Macd > previousCandle.Signal && currentCandle.Macd < currentCandle.Signal)
|
||||
{
|
||||
AddSignal(currentCandle, TradeDirection.Short, Confidence.Medium);
|
||||
}
|
||||
|
||||
if (previousCandle.Histogram < 0 && currentCandle.Histogram > 0 && currentCandle.Macd > 0)
|
||||
{
|
||||
AddSignal(currentCandle, TradeDirection.Long, Confidence.Medium);
|
||||
// Check for MACD line crossing above Signal line (bullish cross)
|
||||
if (previousCandle.Macd < previousCandle.Signal && currentCandle.Macd > currentCandle.Signal)
|
||||
{
|
||||
AddSignal(currentCandle, TradeDirection.Long, Confidence.Medium);
|
||||
}
|
||||
}
|
||||
|
||||
previousCandle = currentCandle;
|
||||
@@ -84,7 +90,8 @@ public class MacdCrossIndicator : Indicator
|
||||
Ticker = candle.Ticker,
|
||||
Exchange = candle.Exchange,
|
||||
Macd = currentMacd.Macd.Value,
|
||||
Histogram = currentMacd.Histogram.Value
|
||||
Histogram = currentMacd.Histogram.Value,
|
||||
Signal = currentMacd.Signal.Value
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,17 +38,26 @@ public class SuperTrendIndicator : Indicator
|
||||
var previousCandle = superTrendCandle[0];
|
||||
foreach (var currentCandle in superTrendCandle.Skip(1))
|
||||
{
|
||||
// Short
|
||||
if (currentCandle.Close < previousCandle.SuperTrend && previousCandle.Close > previousCandle.SuperTrend)
|
||||
{
|
||||
AddSignal(currentCandle, TradeDirection.Short, Confidence.Medium);
|
||||
}
|
||||
// // Short
|
||||
// if (currentCandle.Close < previousCandle.SuperTrend && previousCandle.Close > previousCandle.SuperTrend)
|
||||
// {
|
||||
// AddSignal(currentCandle, TradeDirection.Short, Confidence.Medium);
|
||||
// }
|
||||
//
|
||||
// // Long
|
||||
// if (currentCandle.Close > previousCandle.SuperTrend && previousCandle.Close < previousCandle.SuperTrend)
|
||||
// {
|
||||
// AddSignal(currentCandle, TradeDirection.Long, Confidence.Medium);
|
||||
// }
|
||||
|
||||
// Long
|
||||
if (currentCandle.Close > previousCandle.SuperTrend && previousCandle.Close < previousCandle.SuperTrend)
|
||||
if (currentCandle.SuperTrend < currentCandle.Close)
|
||||
{
|
||||
AddSignal(currentCandle, TradeDirection.Long, Confidence.Medium);
|
||||
}
|
||||
else if (currentCandle.SuperTrend > currentCandle.Close)
|
||||
{
|
||||
AddSignal(currentCandle, TradeDirection.Short, Confidence.Medium);
|
||||
}
|
||||
|
||||
previousCandle = currentCandle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user