set initial capital

#1
My initial capital of each stock is 10000.
I'm going to buy month 5 stocks.
If my programm would like to buy in february one which I already bought in january I do not want to buy it again and do not want to use this initial capital. Does anybody knows an algorithm for that?
 

mastermind007

Well-Known Member
#2
My initial capital of each stock is 10000.
I'm going to buy month 5 stocks.
If my programm would like to buy in february one which I already bought in january I do not want to buy it again and do not want to use this initial capital. Does anybody knows an algorithm for that?
Which software are you going to do this in?

At the very basic programming level, you need a hash table for good speeds

but if you do not have that, you may do with simple sorted string array too.
 
#4
//BackTest
Qnt=Param("Quantity",75,25,1000,25);
Balance=Param("Intial Equity",100000,10000,1000000,1000);
Exposure=Param("Exposure%",10,1,10,1);
SetPositionSize(Qnt,spsShares);

MOP=1;
BRKG=0.0135;
TickSize=0.05;
RoundLotSize=75;
SetOption("AllowSameBarExit",False);
SetOption("ReverseSignalForcesExit",True);
SetOption("ActivateStopsImmediately",False);
SetOption("AllowPositionShrinking" ,False);
SetOption("InitialEquity",Balance);
SetOption("AccountMargin",(100/Exposure));
SetOption("MaxOpenPositions",MOP);
SetOption("CommissionMode",1);
SetOption("CommissionAmount",BRKG);
SetOption("PriceBoundChecking",True);
SetOption("MinShares",1);
SetOption("MinPosValue",1);
SetOption("InterestRate", 0 );
SetOption("FuturesMode",False);

_SECTION_END();
 

Similar threads