isStopLossPriceValidForPosition function
Implementation
bool isStopLossPriceValidForPosition(
MatexStockPositionSizeCalculatorState state,
) {
final isValid = state.stopLossPrice != null && state.stopLossPrice! >= 0;
if (state.isShortPosition) {
return isValid && state.stopLossPrice! > state.entryPrice!;
}
return isValid && state.stopLossPrice! < state.entryPrice!;
}