Advertisement
viamvadens

Untitled

Jul 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. include(dirname(__FILE__) . "/../../../init.php");
  3.  
  4. $data = file(__DIR__ . "/FON_PIN__TENNIS.csv");
  5.  
  6. $P=1000; $W=50;
  7.  
  8. for($P=0; $P<count($data); $P+=5){
  9.  
  10. $sum_amount = 0.0; $sum_profit = 0.0;
  11.  
  12. for($i=$P+1; $i<(count($data) < ($_=$P+$W+1) ? count($data) : $P+$W+1); $i+=1){
  13. $r = explode(";", trim($data[$i], "\r\n\t "));
  14. #print_r($r); exit;
  15. list($bet_result, $cf) = array($r[0], $r[17]);
  16.  
  17. $amount = 100;
  18. $amount = $amount / ($cf - 1);
  19. $profit = $bet_result == 1 ? ($amount * ($cf - 1)) : -$amount;
  20.  
  21. $sum_amount += $amount;
  22. $sum_profit += $profit;
  23. }
  24.  
  25. echo __("%d:\t%d: %.2f x %d = %d\t\t%d / %d\t\tROI=%.2f%%\n", $i-$W, $bet_result, $cf, $amount, $profit, $sum_amount, $sum_profit, ($sum_profit/$sum_amount)*100);
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement