Version 2, last updated by pracplay-support2 at November 10, 2011 22:49 UTC

 

These examples are provided as a help but are not comprehensive examples, nor are they guaranteed to work on every machine.

If you have problems, you should still consult the BridgeGettingStarted, BridgeReference and BridgeTroubleshooting guides.

 

MULTICHARTS

[IntraBarOrderGeneration = false;]
inputs: mydate(1101223);
vars:
offsetflag(0),
Orders(0),
stpamt(0),
flg(0),
mp(0),
barindex(0),
sentflag(0),
cflag(0),
shrtlimit(0),
sentsize(0),
BEstop(0),
realMP(0),
mylimit(0),
mytime(0),
nowtime(0),
myrsi(0),
price(0),
size(0),
mycancel(0);

ONCE sentflag = 0;

DefineDLLFunc: "c:\Program Files\Supports\BridgeHelper.dll",
int, "TSL_SENDORDER",string,bool,int,double,double,int,string,string;
DefineDLLFunc: "c:\Program Files\Supports\BridgeHelper.dll",
double, "TSL_POSPRICE",string;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_POSSIZE",string;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_SENDCANCEL", int;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_SETOFFSET",string,double, double, double , double;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_SETSLOFFSET",string,double, double, double ,string, string;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_CANCELOFFSETS",string;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_SENDCANCELALL", string;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_SENTSIZE", int;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_LASTUPDATETIME";
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_ISCANCELED", int;
DefineDLLFunc: "c:\program files\supports\BridgeHelper.dll",
int, "TSL_NEXTORDERID" ;

size = TSL_POSSIZE("SPY");
sentsize = TSL_SENTSIZE(orders);
mylimit = average(c,2) ;
mp = marketposition;
price = TSL_POSPRICE("SPY");

if size = 0 then offsetflag = 0;
if size = 0 then BEstop = 0;


if date = mydate and time > 1230 and time < 1450
and size = 0
and xxx
and xxx
then begin
value0=TSL_SENDCANCELALL("SPY");
orders=TSL_NEXTORDERID();
value1= TSL_SENDORDER("SPY",true,500,mylimit,0,orders,"Account","EDGX");
end;


if size > 0 and offsetflag = 0 and c < price + .2
then begin
value3 = TSL_SETOFFSET("SPY",.15,.30,.6,1);
offsetflag = 1;
end;

if size > 0 and c >= price + .2 and BEstop = 0 then begin
value4 = TSL_CANCELOFFSETS("SPY");
value5 = TSL_SETOFFSET("SPY",.25,-.05,.5,1);
BEstop = 1;
end;

{if size < 0 and offsetflag = 0 and c > price - .2
then begin
value3 = TSL_SETOFFSET("SPY",.1,.30,.6,1);
offsetflag = 1;
end;

if size < 0 and c <= price - .2 and BEstop = 0 then begin
value4 = TSL_CANCELOFFSETS("SPY");
value5 = TSL_SETOFFSET("SPY",.25,-.05,.5,1);
BEstop = 1;
end;
}
if time = 1558 then begin
if size > 0 then begin
orders=TSL_NEXTORDERID();
value6 = TSL_SENDORDER("MDY",false,size,0,0,orders,"Account","EDGX");
value7 = TSL_CANCELOFFSETS("MDY");
end;
if size < 0 then begin
orders=TSL_NEXTORDERID();
value6 = TSL_SENDORDER("MDY",true,size,0,0,orders,"Account","EDGX");
value7 = TSL_CANCELOFFSETS("MDY");
end;
end;