I am trying to condition if
one of these has null
value, then else but i am getting error:
ErrorException (E_NOTICE) Undefined variable: average_winning_trade
DD(winning_trades_profit)
result : []
here is the code for condition:
if(!empty($losing_trades_loss && $profitable_trades && $winning_trades_profit && $losing_trades)) {
$average_winning_trade = round(array_sum($winning_trades_profit) / $profitable_trades);
$average_losing_trade = array_sum($losing_trades_loss) / $losing_trades;
$payoff_ratio_per_trade = abs(round($average_winning_trade / $average_losing_trade, 2));
}else { $payoff_ratio_per_trade ="0";}