Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Reply
Old 06-29-2009, 07:42 AM   #1

Join Date: Jun 2009
Location: Paris
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Easy Language - Order Last for 24 Hours on 1-min Timeframe

Hi,
I would like to place order on 1-min timeframe, but I need it to last for 24 hours or less if it gets executed.

Entry will be at 10:00AM with stop loss 100 pips.
If order don't get executed, I will cancel old one and place new one next day.
If stop loss gets hit, I don't want to place it again and I will wait for next 10:00AM to place new order.
If order get executed, I will just move Stop loss at next 10:00AM and place new order.

I started to program this strategy, but then I hit problem that easy language does not work as I would when placing order manually (place one order and then wait what happen). In my case easy language place and cancel orders every minute and I can't figure it out how to code this strategy.
Can somebody help me?

Radek
Radek is offline  
Reply With Quote
Old 06-29-2009, 08:06 AM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,778
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Easy Language - Order Last for 24 Hours on 1-min Timeframe

if you post what you have done so far, we can add/modify to it.
Tams is offline  
Reply With Quote
Old 06-29-2009, 09:28 AM   #3

Join Date: Jun 2009
Location: Paris
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Easy Language - Order Last for 24 Hours on 1-min Timeframe

Problem with this is that orders stay open only one bar, in my case 1min. There is also commented part which I wanted to use to move stop loss, but I didn't get there yet.

Radek


Variable:
OpenTime(1000), //Time when Orders are made
DayATR (0),
MP( 0 ), TT( 0 ),
TodayOpen(0),PreviousDayO pen(0),//Opens at OpenTime
OrderRange(0), SLRange(0), DayRange(0)

;


//data1 = 1 minute
//data2 = 1 hour
//data3 = 1 day



if (Time = OpenTime) then
begin
//calculate data
DayATR = AvgTrueRange(10) of data3;
MP = MarketPosition ;
TT = TotalTrades ;
TodayOpen = Open of data2;
PreviousDayOpen = Open[23] of data2;
DayRange = DayATR * PriceScale;
OrderRange = DayRange * .8;
SLRange = DayRange * .3;

{ //if I have long position - move SL
if MP = 1 then
sell on next bar at TodayOpen + (SLRange * 1/PriceScale) stop ;


//if I have short position - move SL
if MP = -1 then
buytocover on next bar at TodayOpen - (SLRange * 1/PriceScale) stop ;
}

//open new order
if TodayOpen < PreviousDayOpen then
begin //long order + SL
buy on next bar at TodayOpen + (OrderRange * 1/PriceScale) stop;
sell on next bar at TodayOpen + (SLRange * 1/PriceScale) stop ;
end
else
begin //short order + SL
sellshort on next bar at TodayOpen - (OrderRange * 1/PriceScale) stop;
buytocover on next bar at TodayOpen - (SLRange * 1/PriceScale) stop ;

end;


end;
Radek is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy Language Help JKLM Automated Trading 7 02-10-2009 11:17 PM
Easy Language - Question ephi144 Coding Forum 1 01-25-2009 10:15 PM
Help with Easy Language BrianA Coding Forum 29 01-13-2009 03:32 PM
Easy Language Strategy Help Marc33139 Automated Trading 3 07-28-2008 11:35 AM
Easy Language - Help with Simple System gatrader E-mini Futures Trading Laboratory 8 12-17-2007 06:40 PM

All times are GMT -4. The time now is 10:39 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.