Robot.ModifyPosition(Position, double?, double?)' is obsolete
Robot.ModifyPosition(Position, double?, double?)' is obsolete
05 Feb 2025, 16:05
Hi people:
I have a problem whit this linea on my code:
protected override void OnTick()
{
foreach (var position in BotPositions)
{
double newStopLoss = position.TradeType == TradeType.Buy ? _supertrend.UpTrend.Last(0) : _supertrend.DownTrend.Last(0);
// Solo modificamos el StopLoss, dejando el TakeProfit sin cambios
ModifyPosition(position, newStopLoss, position.TakeProfit);
}
}
there is a warning:
Warning CS0618: 'Robot.ModifyPosition(Position, double?, double?)' is obsolete: 'Please use new version with Protection Type parameter.' (C:\Users VORGE\Documents\cAlgo\Source\Robots\SuperTrend\SuperTrend SuperTrend.cs, line: 71, column: 17)
How can I fixed?
firemyst
20 Feb 2025, 23:46
By doing exactly what the warning message tells you to.
@firemyst