Highest high and highest low of previous days and of specific schedules
Forums › ProRealTime English forum › ProOrder support › Highest high and highest low of previous days and of specific schedules
- This topic has 38 replies, 6 voices, and was last updated 5 years ago by robertogozzi.
Tagged: highest high, lowest low
-
-
09/24/2018 at 7:05 PM #81236
Team
Can anyone help me to get code following requirement for time frame of 30 Minutes.
1 ) Highest of high of previous day bars for trading duration of 10.00 Am to 16.00PM
2) Lowest of lows of previous day bars for trading duration of 10.00 Am to 16.00PM
3) Highest of high of a day before previous day bars for trading duration of 10.00 Am to 16.00PM
4) Lowest of lows of a the day before previous day bars for trading duration of 10.00 Am to 16.00PM
5) same above information but for last 5 days.
Thanks.
09/25/2018 at 7:12 AM #81251This little snippet will plot lines for the last 5 days highest high and lowest low, calculated in a specific time range:
123456789101112131415161718192021starthour = 100000endhour = 160000count = today-datetcondition = time>=starthour and time<=endhourif count<=5 and count>0 thenif tcondition thenhh=max(hh,high)ll=min(ll,low)endifif tcondition[1] and not tcondition thendrawhline(hh) coloured(0,255,0)drawhline(ll) coloured(255,0,0)hh=0ll=close*1000endifendifreturn09/25/2018 at 1:57 PM #8128409/25/2018 at 7:23 PM #81297Hi Nicolas
I pasted above code in Indicator & trading system – Indicator – New. Then added this indicator to US500 but I could not see any indicator. I mean I did not get any result.
aslo tried to use it code for strategy, but did not get any result. Appreciate if you could you please check at your end & guide me.
I actually need to use in the strategy for auto trading. So please advice.
Thanks.
09/25/2018 at 8:01 PM #8130009/25/2018 at 8:50 PM #81304I pasted above code in Indicator & trading system – Indicator – New. Then added this indicator to US500 but I could not see any indicator. I mean I did not get any result.
Click on the spanner in the corner of the chart that you want to add it to and add it directly to the chart rather than as a separate indicator window.
09/26/2018 at 4:01 PM #81366The code I made is working for the 5 previous days, as the way you wanted it to be. But I also realize that it would also count the weekend as trading days .. Tell me if it’s working as intended and then I’ll try to change the code to work around this problem.
09/26/2018 at 7:11 PM #81383Hi Nicolas
I used this code to program indicator and then tried adding it to the chart. But no results. I am new to Prorealtime. Appreciate if you. let me know the exact steps to follow. I am using 30min chart set for UK time (custom trading hours) i.e. 14.30 to 21.00 UK time for US500 chart.
Thanks.
09/27/2018 at 8:59 AM #8141409/29/2018 at 9:14 AM #81590Hi Nicolas and Vonasi
Unfortunately I am unable to do and achieve what you advised. This is because I am too new to Prorealtime.
- Please advice on stpes to get screen shots as per proreI am not interealtime forum requirement so that I can forward to step wise screen shots of what am doing wha6 what I get.
You certainly will then find out what wrong I am doing.
2 I am not interested in showing my original requirement (lowest low & highest high of of last 5 days for specific time frame) on chart. I need code for it to use those value in trading strategy. Appreciate to have the code to get that information. If you ue Graph function to get those value it will be useful for me to verify the results.
Thanks
09/29/2018 at 12:11 PM #81593I am not interested in showing my original requirement (lowest low & highest high of of last 5 days for specific time frame) on chart. I need code for it to use those value in trading strategy.
You have posted your request in the ProBuilder forum which is a forum to discuss indicators and not strategies. This is why Nicolas has provided code to display the lines on a chart as an indicator and not code that can be used in a strategy.
Please try to post in the correct forum with future requests as it saves a lot of time and confusion.
Topic now moved to the ProOrder forum.
09/29/2018 at 12:50 PM #81595You could try something like this in a strategy:
12345678910111213141516starthour = 100000endhour = 160000if time = starthour thenhh2 = hh1hh1 = hhhh = closell2 = ll1ll1 = llll = close * 1000endifif time >= starthour and time <= endhour thenhh = max(hh, high)ll = min(ll, low)endifHH1 = highest high 1 day ago between start time and finish time
LL1 = lowest low 1 day ago between start time and finish time
HH2 = highest high 2 days ago between start time and finish time
LL2 = lowest low 2 days ago between start time and finish time
Only works on 1 hour or faster charts.
09/29/2018 at 7:07 PM #81610Hi Vonasi
It is working. Great. Thanks a lot.
Could you please further advice on code modification for below modified requirement.
HH1 = highest high 1 day ago between start time = a and finish time = b
LL1 = lowest low 1 day ago between start time = a and finish time = b
HH2 = highest high 2 days ago between start time = c and finish time d
LL2 = lowest low 2 days ago between start time = c and finish time = d
I mean HH1, LL1 and HH2 LL2 for different time frames for previous & day before previous.
Thanks.
09/29/2018 at 8:34 PM #81611Just put two versions of the same code in your strategy but modify the variable names in the second version then you can select whichever set of results from each day that you want.
123456789101112131415161718192021222324252627282930313233starthour = 100000 //aendhour = 160000 //bif time = starthour thenhh2 = hh1hh1 = hhhh = closell2 = ll1ll1 = llll = close * 1000endifif time >= starthour and time <= endhour thenhh = max(hh, high)ll = min(ll, low)endifstarthour2 = 110000 //cendhour2 = 150000 //dif time = starthour2 then2hh2 = 2hh12hh1 = 2hh2hh = close2ll2 = 2ll12ll1 = 2ll2ll = close * 1000endifif time >= starthour2 and time <= endhour2 then2hh = max(2hh, high)2ll = min(2ll, low)endifHH1 = highest high 1 day ago between start time = a and finish time = b
LL1 = lowest low 1 day ago between start time = a and finish time = b
2HH2 = highest high 2 days ago between start time = c and finish time d
2LL2 = lowest low 2 days ago between start time = c and finish time = d
10/03/2018 at 6:31 PM #81858Hi Vonasi
It is working. Thanks a lot for your support.
I am working on strategy. I have selected US500 with custom trading hours (143000 – 210000) UK time as seen on my charts in UAE.
The condition satisfied end of the day at 210000, open a trade at 120000 midnight UK time instead of opening next day at 1430000.
I want that condition satisfied end of the day on custom trading hours (in my case at 210000 UK time) to open trade next day at opening of customer trading hours (in my case at 1430000 UK time).
Can you please advice on code to achieve above requirement.
Thanks.
-
AuthorPosts
Find exclusive trading pro-tools on