| Automated Trading Black box systems, strategy automation, algorithmic trading, etc... |
![]() | | Tweet | |
| | #1 | ||
![]() | Easy Language - Order Last for 24 Hours on 1-min Timeframe 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 | ||
| |
|
| | #2 | ||
![]() | Re: Easy Language - Order Last for 24 Hours on 1-min Timeframe | ||
| |
|
| | #3 | ||
![]() | Re: Easy Language - Order Last for 24 Hours on 1-min Timeframe 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; | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | 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 |