Introduce a delay in a Strategy

gramme7

Newbie
Messages
3
Likes
0
Hello,
I trade with a 1min chart, I use TS2000i and Braket trader to send the order to my broker. I generate a text file from TS2000i that Braket trader read every 200msecond.

I would like to introduce a delay of about 250ms-300ms, between to order generated by the same condition to reverve my position when I am already in a position.
Because my problem is that the two line generated in the text file have the same time stamp.
I do not want to modify the time stamp, I only want to introduce a delay at the location indicated below before TS2000 write the second order to enable Braket Trader to manage the first order and then the second instead of ignore the first one.
Can you please if it is possible to create a counter or a loop which count 250ms.

Thaks you for your help. And please find below the code.


if Condition1 then
if Condition2 then
if MarketPosition=-1 {to test if I am already Short} then
begin
{I generate the file to exit from my current position}
FileAppend("C:\BracketTrader\Signals\Entries.txt","cxlplace,BUY,1,MKT,,0,20"+RightStr(numtostr(D,0),6)+numtostr(Time-1,0)+"0,EXIT"+ NewLine);
Buy ( "jup2" ) next bar at close-vale Limit;
{LOCATION WHERE I WANT TO INTRODUCE A DELAY OF ABOUT 250ms BEFORE TO GENERATE THE ORDER TO ENTER IN THE NEW DIRECTION}
FileAppend("C:\BracketTrader\Signals\Entries.txt","cxlplace,BUY,1,LMT,"+numtostr((Close-vale),2)+",0,20"+RightStr(numtostr(D,0),6)+numtostr(Time,0)+"0,ENTRY"+ NewLine);
end;
 
Running it in TS should introduce plenty of delay as is. :) If not, you might need to do this in a DLL.

jj
 
Hello,
I trade with a 1min chart, I use TS2000i and Braket trader to send the order to my broker. I generate a text file from TS2000i that Braket trader read every 200msecond.

I would like to introduce a delay of about 250ms-300ms, between to order generated by the same condition to reverve my position when I am already in a position.
Because my problem is that the two line generated in the text file have the same time stamp.
I do not want to modify the time stamp, I only want to introduce a delay at the location indicated below before TS2000 write the second order to enable Braket Trader to manage the first order and then the second instead of ignore the first one.
Can you please if it is possible to create a counter or a loop which count 250ms.

Thaks you for your help. And please find below the code.


if Condition1 then
if Condition2 then
if MarketPosition=-1 {to test if I am already Short} then
begin
{I generate the file to exit from my current position}
FileAppend("C:\BracketTrader\Signals\Entries.txt","cxlplace,BUY,1,MKT,,0,20"+RightStr(numtostr(D,0),6)+numtostr(Time-1,0)+"0,EXIT"+ NewLine);
Buy ( "jup2" ) next bar at close-vale Limit;
{LOCATION WHERE I WANT TO INTRODUCE A DELAY OF ABOUT 250ms BEFORE TO GENERATE THE ORDER TO ENTER IN THE NEW DIRECTION}
FileAppend("C:\BracketTrader\Signals\Entries.txt","cxlplace,BUY,1,LMT,"+numtostr((Close-vale),2)+",0,20"+RightStr(numtostr(D,0),6)+numtostr(Time,0)+"0,ENTRY"+ NewLine);
end;

Hi,

I remember when using controllers we just used a FOR loop summing integers. You can determine delay by testing.
 
Were can I get TS2000I,

Interested in were I can get TS2000I and braket trader, looking for some good software tools to use.



Hello,
I trade with a 1min chart, I use TS2000i and Braket trader to send the order to my broker. I generate a text file from TS2000i that Braket trader read every 200msecond.

I would like to introduce a delay of about 250ms-300ms, between to order generated by the same condition to reverve my position when I am already in a position.
Because my problem is that the two line generated in the text file have the same time stamp.
I do not want to modify the time stamp, I only want to introduce a delay at the location indicated below before TS2000 write the second order to enable Braket Trader to manage the first order and then the second instead of ignore the first one.
Can you please if it is possible to create a counter or a loop which count 250ms.

Thaks you for your help. And please find below the code.


if Condition1 then
if Condition2 then
if MarketPosition=-1 {to test if I am already Short} then
begin
{I generate the file to exit from my current position}
FileAppend("C:\BracketTrader\Signals\Entries.txt","cxlplace,BUY,1,MKT,,0,20"+RightStr(numtostr(D,0),6)+numtostr(Time-1,0)+"0,EXIT"+ NewLine);
Buy ( "jup2" ) next bar at close-vale Limit;
{LOCATION WHERE I WANT TO INTRODUCE A DELAY OF ABOUT 250ms BEFORE TO GENERATE THE ORDER TO ENTER IN THE NEW DIRECTION}
FileAppend("C:\BracketTrader\Signals\Entries.txt","cxlplace,BUY,1,LMT,"+numtostr((Close-vale),2)+",0,20"+RightStr(numtostr(D,0),6)+numtostr(Time,0)+"0,ENTRY"+ NewLine);
end;
 
New Forex Gurus and their courses

Every other week some guru comes out with a system that is sure to make money.
I am very sceptical especially I had bought a number of so called Guru's system when I first started trading forex.

Can anyone give some feedback on FPA system by Bill Poulis. I notice he is now launching another system to enable Forex trades to trade intraday.

Retnam
 
Top