PureBytes Links
Trading Reference Links
|
On 3/14/2010 11:48 PM, Aron wrote:
> Hello interested !
>
> I have had no nerves recently to through the whole process that
> requires CBT.
> that's why I'm asking for any input regarding the following trading
> system (conceptual or technical);
>
> Wha do got:
>
> 1. unlimited basket of instruments
> 2. fixed fractional money management
>
> and there its how it goes to make it simple for those unfamiliar with
> volatility, trading costs and mathematical reality (I'm far for being
> an expert on this one) :
>
> the title of my project is : "ROULETTE BREAKER"
> the systemis imposible to be applied in the tables of casinos but it
> might find place in fin. markets easily (not efficiently).
> I'm sorry to give just the code for the moment.But i have done a lot
> of additional code that will assist those interested,
> By the way its an indicator: you just plot it.
>
>
>
>> SetBarsRequired(0,sbrAll);
>>
>> msg = "\n-------------------------------";
>> tot = 0;
>> num = 0;
>>
>> totspins = 0;
>> totRed = 0;
>> totBlack = 0;
>> totzero = 0;
>> incr = 1;
>> for (n = 40; n <=60; n = n +incr)
>> {
>> num++;
>> e[0] = 100;
>> balckEquity[0] = e[0]/2;
>> redEquity[0] = e[0]/2;
>>
>> Risk = 1/100;
>> res = mtRandomA() * 100 > n;
>> zero = mtRandomA() <1/37;
>> Spins = 0;
>> red = 0;
>> black = 0;
>> zero = 0;
>>
>> for ( i = 1; i < BarCount; i++)
>> {
>> spins++;
>> totspins ++;
>>
>> if ( zero[i])
>> {
>>
>> balckEquity[i] = balckEquity[i-1] * (1-Risk/2);
>> redEquity[i] = redEquity[i-1] * (1-Risk/2);
>> zero ++;
>> totzero ++;
>> }
>> else
>> {
>> if ( res[i])
>> {
>> balckEquity[i] = balckEquity[i-1] * (1+Risk);
>> redEquity[i] = redEquity[i-1] * (1-Risk);
>> red ++ ;
>> totRed++;
>> }
>> else
>> {
>> balckEquity[i] = balckEquity[i-1] * (1-Risk);
>> redEquity[i] = redEquity[i-1] * (1+Risk);
>> black ++;
>> totBlack++;
>> }
>> }
>> e[i] = balckEquity[i] + redEquity[i];
>>
>> if ( frac(spins/7) ==0)
>> {
>> //balckEquity[i] = e[i]/2;
>> //redEquity[i] = e[i]/2;
>> }
>> }
>>
>> Plot( e, "", colorGreen, styleLine|styleNoLabel);
>>
>> msg = msg + StrFormat("\n# %g equity = %g (%.1f%%)
>> {{VALUES}} " , num,e, (black/spins * 100));
>> tot = tot + e;
>>
>> }
>>
>> av = tot/num ;
>> Plot( av, "", colorOrange, styleLine|styleThick|styleArea);
>>
>> Title = "Table of Results : " +msg+
>> "\n---------------------------------" +
>> "\nAverage Equity = " + av +
>> "\nTotal spins = " + totspins +
>> "\nRed/Black Ratio = " + totRed/totBlack +
>> "\nZero = " + totzero/totspins*100 + " %";
>
> Aron
>
I played a little with variable names so Zero occurrences did not show
appropriately the right thing is below:
_SECTION_BEGIN("2. Roulette Breaker");
SetBarsRequired(0,sbrAll);
msg = "\n-------------------------------";
tot = 0;
num = 0;
totspins = 0;
totRed = 0;
totBlack = 0;
totzero = 0;
incr = 1;
for (n = 40; n <=60; n = n +incr)
{
num++;
e[0] = 100;
balckEquity[0] = e[0]/2;
redEquity[0] = e[0]/2;
Risk = 1/100;
res = mtRandomA() * 100 > n;
zero = mtRandomA() <1/37;
Spins = 0;
red = 0;
black = 0;
//z= 0;
for ( i = 1; i < BarCount; i++)
{
spins++;
totspins ++;
if ( zero[i])
{
balckEquity[i] = balckEquity[i-1] * (1-Risk/2);
redEquity[i] = redEquity[i-1] * (1-Risk/2);
// z ++;
totzero ++;
}
else
{
if ( res[i])
{
balckEquity[i] = balckEquity[i-1] * (1+Risk);
redEquity[i] = redEquity[i-1] * (1-Risk);
red ++ ;
totRed++;
}
else
{
balckEquity[i] = balckEquity[i-1] * (1-Risk);
redEquity[i] = redEquity[i-1] * (1+Risk);
black ++;
totBlack++;
}
}
e[i] = balckEquity[i] + redEquity[i];
if ( frac(spins/7) ==0)
{
//balckEquity[i] = e[i]/2;
//redEquity[i] = e[i]/2;
}
}
Plot( e, "", colorGreen, styleLine|styleNoLabel);
msg = msg + StrFormat("\n# %g equity = %g (%.1f%%) {{VALUES}}
" , num,e, (black/spins * 100));
tot = tot + e;
}
av = tot/num ;
Plot( av, "", colorOrange, styleLine|styleThick|styleArea);
Title = "Table of Results : " +msg+
"\n---------------------------------" +
"\nAverage Equity = " + av +
"\nTotal spins = " + totspins +
"\nRed/Black Ratio = " + totRed/totBlack +
"\nZero = " + totzero/totspins*100 + " %";
_SECTION_END();
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
amibroker-digest@xxxxxxxxxxxxxxx
amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|