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
-
-
10/03/2018 at 6:57 PM #8186210/04/2018 at 6:44 PM #81953
Hi Vonasi
Thanks a lot for your guidance. It is working. I have another issue now.
- I have selected custom trading hours as 143000 to 210000.
- Condition satisfied at 210000, sets the flag=1. When flag =1 and time = 1430000, I am not getting any trade at 1430000. For that I have to select custom trading hours as 140000 to 210000. But I do not want to select that trading hours since other calculations of strategy (moving averaage, RSI) etc consider Intraday bar of 140000 to 143000 for calculation.which I do not want to consider for calculation and still I want trade to open at 143000 only.
So please advice solutions for this issue.
Thanks.
10/09/2018 at 12:14 PM #8235810/09/2018 at 3:21 PM #8237310/10/2018 at 7:19 PM #8251210/10/2018 at 9:31 PM #82521Nicolas is requesting that you post your modified code as it is far easier to find a coding problem with the code rather than just a description of what you expect it to do!
Use the ‘Insert PRT Code’ button and cut and paste your code into the box and I’m sure someone will quickly spot why your strategy is not behaving as you expect it to.
10/13/2018 at 7:03 PM #82715Hi 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.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374// Conditions to enter long positionsDEFPARAM CUMULATEORDERS = FALSEstarthour = 150000endhour = 210000if time = starthour thenhh4 = hh3hh3 = hh2hh2 = hh1hh1 = hhhh = closell4 = ll3ll3 = ll2ll2 = ll1ll1 = llll = close*1000endifif time >= starthour and time <= endhour thenhh = max (hh, high)ll = min (ll, low)endifstarthour2 = 170000endhour2 = 210000if time = starthour2 thenahh5 = ahh4ahh4 = ahh3ahh3 = ahh2ahh2 = ahh1ahh1 = ahhahh = closeall5 = all4all4 = all3all3 = all2all2 = all1all1 = allall = close*1000endifif time >= starthour2 and time <= endhour2 thenahh = max (ahh, high)all = min (all, low)endifREM Computes the highest and lowest prices on p barshi1 = 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)) * 100r=5r1=2lineK = average[r](oscillator1)lineD = average[r1](lineK)e1 = LineK > LineD AND time = 210000if e1 thenflag1 = 1endifIf flag1 and time = 143000 thenBuy 5 Contracts at marketendifSET STOP %LOSS 0.32If Longonmarket and (BarIndex - TradeIndex) >= 10 thenSell at marketendifif time = 160000 thenflag1 = 0endif10/16/2018 at 5:24 PM #8291310/16/2018 at 8:19 PM #82925The 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.
I’m not sure I understand what the problem is exactly from your description. I would suggest using GRAPH to show TIME so that you can see what the TIME of the candle when you want a trade to open actually is. I often prefer OPENTIME when writing a code as my brain seems to understand this better!
11/23/2018 at 9:11 PM #85611Hi Vonasi
Please refer to below simple code to know the issue. This code is executed on Proreal time demo platform but nt on real Proreal time platform. All settings are same on both plaatforms.
Could you please advice on solution to be able to execute simililar code in Real time Proreal time platform.
Thanks
123456789101112131415if time = 210000 thenflag = 1endifIF NOT LongOnMarket AND flag and time = 143000 THENBUY 10 CONTRACTS AT MARKETENDIFIf LongOnMarket AND time = 203000 THENSELL AT MARKETENDIFif time = 203000 thenflag = 0endif11/23/2018 at 10:37 PM #85615I can’t explain to you why it works on demo but not on real. I am not willing to test that strategy on my own real account as it could be very expensive! It works fine on my demo account.
I would suggest sending a technical help request from your live account with a link to this topic within your description.
11/24/2018 at 8:12 AM #85624Hi Vonasi
Thanks for your reply. I back tested above strategy both in Demo & real plat forms. It work in demo but not in real. It was not real auto trading testing. I back tested it to see the result.
Can you back test real plat form. I am sure you will get some clue/solution.
Meanwhile I will online check with technical team as you advised.
Thanks.
11/24/2018 at 11:24 AM #856271234567if time = 210000 thenflag = 1endifIF NOT LongOnMarket AND flag and time = 143000 THENBUY 10 CONTRACTS AT MARKETENDIFIs above above correct ? How can Time = 210000 and also Time = 143000 ??
11/24/2018 at 11:42 AM #85628GraHal he doesn’t check the two time values together, he just SETS a flag at that time, which will not be cleared till 203000 the next day, so at 143000 the next day FLAG will still be set.
He wants to stay off trading just 30 minutes, from 203000 to 210000.
11/24/2018 at 12:41 PM #85631Ah gotcha Roberto, thank you!
I looked for guidance on using Flags (after posting my query above) but it looks straightforward?
I was mixing Flags up with … when a condition is true and would, for example, show as = 1 using GRAPH under an equity curve?
Or do I still need to find / read up on Flags!? 🙂
-
AuthorPosts
Find exclusive trading pro-tools on