Trade Input Version 2

I have requests from some users to program a little more sophisticated version of my trade input strategy.  This is where you can simply list the trade, trade date, and trade price and TradeStation will plot the trades for you and calculate the performance.  This is a an easier to use program then TS’s _HistoricalEntry strategy.


{If you are entering the next bar then use the prior bars date
 Make sure your price is above or below open if stop or limit order
}

array: DateArray[1000](0),BorSArray[1000](""),PriceArray[1000](0);
vars: iCnt(1);

DateArray[1]=1141117;	BorSArray[1]="S";	PriceArray[1]=75.00;
DateArray[2]=1141219;	BorSArray[2]="F";	PriceArray[2]=59.01;
DateArray[3]=1150102;	BorSArray[3]="B";	PriceArray[3]=53.10;
DateArray[4]=1150210;	BorSArray[4]="S";	PriceArray[4]=50.00;


if date >= dateArray[1] then
begin
	if date = dateArray[iCnt] then
	begin
		if BorSArray[iCnt] = "B" then buy next bar at PriceArray[iCnt] stop;
		if BorSArray[iCnt] = "S" then sellShort next bar at PriceArray[iCnt] stop;
		if BorSArray[iCnt] = "F" then 
		begin
			if marketPosition = 1 then sell next bar at PriceArray[iCnt] stop;
			if marketPosition =-1 then buytocover next bar at PriceArray[iCnt] stop;
		end;
		iCnt = iCnt + 1;
	end;
end;


Discover more from George Pruitt

Subscribe to get the latest posts sent to your email.

Leave a Reply