Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

Radek

Members
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by Radek

  1. 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),PreviousDayOpen(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;
  2. 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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.