I would assume there would be a model determining profitability of transactions and that there would be a probabilistic component of the profitability of a given transaction.
Then, you need to draw realizations from the appropriate distribution for that probabilistic component and calculate profitability for all transactions entered. Obviously, one also has to think about which transactions would be entered into: Why enter a transaction which is not ex ante profitable according to some criterion? But, I do not know enough to comment on that.
Be careful not to use the built-in RNG: On Windows, that will basically give you only 32768 possible values.
Here is a silly example:
#!/usr/bin/perl
use strict; use warnings;
use List::Util qw( sum );
my @projects = map { mk_project() } 1 .. 1_000;
for my $i (1 .. 10) {
my $r = rand;
my @profits = map { $_->($r) } @projects;
my $avg_profits = sum( @profits ) / @profits;
my $n_profitable = grep { $_ >= 0 } @profits;
print "Profits: $avg_profits\tProfitable: $n_profitable\n";
}
sub mk_project {
my $m = rand;
return sub {
my ($r) = @_;
return 10*($r - $m);
}
}