|
Honolulu + Hawaii / USA
Posts: 18 since Jul 2014
Thanks Given: 16
Thanks Received: 1
|
I have another question. Is it possible to make the trading bot close all positions by a certain time? I plan to use Global Futures and the $500 intraday trading margin and holding a postion past 4:15pm EST results in full margin.
Mahalo,
Honolulu Hustler
Inputs: Price( Open ),
Length1 ( 15 ),
Length2 ( 20 )
Cts ( 4 ),
TGT ( 100 ),
STP ( 75 );
Vars: ExpAv1 ( 0 ),
PrevNetProfit ( 0 ),
PrevNetLoss ( 0 ),
StopTrading (false),
ROC1 ( 0 );
ExpAv1 = XAverage ( Price, Length1 ) ;
ROC1 = ( PRICE - PRICE[Length2] ) / PRICE[Length2] * 100 ; { RATE OF CHANGE }
if Date <> Date [1] then
begin
PrevNetProfit = NetProfit;
StopTrading = false;
end;
if NetProfit >= PrevNetProfit + 100 then StopTrading = true;
if Date <> Date [1] then
begin
PrevNetLoss = NetLoss;
StopTrading = false;
end;
if NetLoss >= PrevNetLoss + 80 then StopTrading = true;
{Buy or short sell contracts at exponential average crossovers}
if volume > 5000 and ROC1 > 0 and Price[1] crosses above ExpAv1[1] then
begin
buy ( "buy") Cts contracts next bar at market ;
setprofittarget (TGT);
setstoploss (STP);
end;
value97 = text_new ( D, T, ExpAv1, "*" );
text_setcolor (Value97, Cyan);
|