Weird null reference error
Weird null reference error
25 Sep 2022, 05:03
Any idea why this would throw a null reference error when the print line is working but my bot is crashing on the boolean comparisons?
Print($"Does this work? {positionHighestProfit}");
if ((currentProfit < (positionHighestProfit * .75)) && (positionHighestProfit > 25))
{
try {
Print($"Got here at least");
ClosePosition(position);
Print($"Closed position {position.Label}");
} catch(NullReferenceException err){
Print($"{err.Message}");
}
}
PanagiotisCharalampous
26 Sep 2022, 10:50
Hi there,
In order to help you we need the full cBot code as well as exact steps to reproduce the problem.
Best Regards,
Panagiotis
Join us on Telegram and Facebook
@PanagiotisCharalampous