Forums › ProRealTime English forum › ProOrder support › Highest high and highest low of previous days and of specific schedules › Reply To: Highest high and highest low of previous days and of specific schedules
		10/13/2018 at 7:03 PM
		
		#82715
		
		
		
	
Hi Vonasi/Nicolas
Thanks for the clarifications. Please review below code and guide me.
The trade open at 143000 only when custom trading hours are 140000 to 210000. I want trade to open at 143000 when custom trading hours are 143000 to 210000 based on condition satisfied a day before at 210000.
Thanks.
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74  | 
						// Conditions to enter long positions  DEFPARAM CUMULATEORDERS = FALSE  starthour = 150000  endhour = 210000  if time = starthour then  hh4 = hh3  hh3 = hh2  hh2 = hh1  hh1 = hh  hh = close  ll4 = ll3  ll3 = ll2  ll2 = ll1  ll1 = ll  ll = close*1000  endif  if time >= starthour and time <= endhour then hh = max (hh, high) ll = min (ll, low)  endif  starthour2 = 170000  endhour2 = 210000  if time = starthour2 then  ahh5 = ahh4  ahh4 = ahh3  ahh3 = ahh2  ahh2 = ahh1  ahh1 = ahh  ahh = close  all5 = all4  all4 = all3  all3 = all2  all2 = all1  all1 = all  all = close*1000  endif  if time >= starthour2 and time <= endhour2 then  ahh = max (ahh, high)  all = min (all, low)  endif  REM Computes the highest and lowest prices on p bars  hi1 = Max(hh,Max(hh1,Max(hh2,Max(hh3,Max(hh4,ahh5)))))  lo1 = Min(ll,Min(ll1,Min(ll2,Min(ll3,Min(ll4,all5)))))  oscillator1 = ((close - lo1) / (hi1 - lo1)) * 100  r=5  r1=2  lineK = average[r](oscillator1)  lineD = average[r1](lineK)  e1 = LineK > LineD AND time = 210000  if e1 then  flag1 = 1  endif  If flag1 and time = 143000 then  Buy 5 Contracts at market  endif  SET STOP %LOSS 0.32  If Longonmarket and (BarIndex - TradeIndex) >= 10 then  Sell at market  endif  if time = 160000 then  flag1 = 0  endif  |