What do you think of this C code that demonstrates why and when people lose all their money in trade? <string.h>
Stdlib.h
int main (int argc, char ** argv) (
double amount;
twofold;
int winperc;
decrperc int = 10;
whichcase int;
int howmuch;
volatile int = 5;
limvolatil int = 4;
int count = 0;
double the investment;
int invert = 1;
if (argc <3) (
printf ("\ nhow operations do you need to lose all your money? This program demonstrates the secret golden rule of negotiation (aka: why some good investors lose their money): Whenever you have a big loss should reduce the capital investment Ricuperati and whenever you have a great victory, you should increase it. People generally do the opposite \ n ");
printf ("\ nforex [capital] [Capital target] win [percentage] [reverse] \ n \ n");
printf ("(winning percentage = how many times you win all 100, invert = 0 to follow the golden rule and do not follow 1) \ n");
printf ("nExample \. Forex 50 100 60 1 \ n \ n");
printf ("What you will discover, you discover each time you do not follow the golden rule (reverse = 1), you lose all your money and every time you follow (invert = 0) you have achieved your target capital \ nGood Search people \ n ");
printf ("\ n__Cyber_traveller__ \ n \ n");
exit (1);
)
invert = atoi (argv [4]);
amount = atoi (argv [1]);
target = atoi (argv [2]);
winperc = atoi (argv [3]);
/ / [Decrperc argv = 4];
/ / Volatility = argv [5];
srand (time (NULL));
= amount invested;
C (
count + +;
whichcase = rand ()% 100 + 1;
howmuch = rand ()% volatility;
if (<= whichcase winperc)
(
if (invert == 0) (
if (> = howmuch limvolatil) (
if (investing <(amount * 3))
invest invest = + ((invest / 100) * decrperc);
printf ("Grossa vincita \ n");
)
) Else (
if (> = howmuch limvolatil) (
if (invest> (amount / 8))
invest invest = - ((invest / 100) * decrperc);
printf ("Perdita Grossa \ n");
)
)
= Amount invested + ((amount/100) * howmuch);
)
else
(
if (invert == 0) (
if (> = howmuch limvolatil) (
if (invest> (amount / 8))
invest invest = - ((invest / 100) * decrperc);
printf ("Perdita Grossa \ n");
)
) Else (
if (> = howmuch limvolatil) (
if (investing <(amount * 3))
invest invest = + ((invest / 100) * decrperc);
printf ("Grossa vincita \ n");
)
)
= Amount invested - ((amount/100) * howmuch);
)
amount printf ("amount = <% f> - investment = <% f> \ n", invest);
) While ((> Amount (double) 1) & & (<amount (double) target));
printf ("---------------------- \ nOperatio ... = <% i> \ n ", count);
return 0;
)
much. formatting is terrible.
Posted on January 9, 2010.