Random entry level
Forums › ProRealTime English forum › ProOrder support › Random entry level
- This topic has 7 replies, 4 voices, and was last updated 2 years ago by
Tropic.
-
-
10/19/2022 at 12:04 PM #202824
Hi guys, i did this code that should go short at minimum of previous day and long at maximum prev day,
1234567891011121314151617// Definizione dei parametri del codiceDEFPARAM CumulateOrders = False // Posizioni cumulate disattivateDEFPARAM FLATAFTER = 220000DEFPARAM FLATBEFORE = 010000// Condizioni per entrare su posizioni longc1 = (ABS((Dopen(1)-Dclose(1))))<= ((ABS((Dhigh(1)-Dlow(1))))/2)IF c1 THENBUY 1 share AT Dhigh(1) stopENDIF// Condizioni per entrare su posizioni shortc2 = (ABS((Dopen(1)-Dclose(1))))<= ((ABS((Dhigh(1)-Dlow(1))))/2)IF c2 THENSELLSHORT 1 share AT Dlow(1) stopENDIFProblem is that sometime the entry level is totally random not according with the code, like in the photo. Do you know why? Thanks
10/19/2022 at 12:35 PM #20282610/19/2022 at 3:16 PM #202830Firstly you should graph on the price chart what is the value of dlow(1), so you have an hint of what the code is using:
1graphonprice dlow(1)Are you using custom trading hours? Because the OHLC constants returned by instruction such as Dlow are always using the official instrument timezone.
10/19/2022 at 7:49 PM #202832Thanks Nicholas, custom trading hours? I don’k know what it is so i think no im not using that, just left the default chart price but now i can understand the problem, the problem is on the Mondays. I’m on the Gold (Spot Gold mini 10 oz, hope this is the right chart for the standard gold quote) and i see that dlow(1) and dhigh(1) don’t take the lowest and the highest price of the previous Friday but something different. I think i can solve this but can you explain me why this happens? Gold quotations are by Monday 0.00 to Friday 22.30 right ? So what’s there that changes the variable of dlow(1) and dhigh(1) ??
10/19/2022 at 8:25 PM #202833Since I use similar stuff I can say… On Mondays Dhigh and Dlow is taken over from Sunday trading. Sunday evening the forex and gold market is open from 10:00 p.m. and a Sunday candle is lit. A dhigh(1), which is used on Monday, then refers to this candle.
10/19/2022 at 8:52 PM #202834good evening, does this code change anything
123456789101112131415161718192021DEFPARAM CumulateOrders = False // Posizioni cumulate disattivateDEFPARAM FLATAFTER = 220000DEFPARAM FLATBEFORE = 010000if OpenDayOfWeek>0 and OpenDayOfWeek<=5 thendailylow=dlow(0)dailyhigh=dhigh(0)endif// Condizioni per entrare su posizioni longc1 = (ABS((Dopen(1)-Dclose(1))))<= ((ABS((dailyhigh[1]-dailylow[1])))/2)IF c1 THENBUY 1 share AT Dhigh(1) stopENDIF// Condizioni per entrare su posizioni shortc2 = (ABS((Dopen(1)-Dclose(1))))<= ((ABS((dailyhigh[1]-dailylow[1])))/2)IF c2 THENSELLSHORT 1 share AT Dlow(1) stopENDIF10/20/2022 at 11:45 AM #202850Really? So the gold market opens on Sunday at 10.00 pm like the Forex? that is strange cause on the gold’s chart it doesn’t show the Sunday candle, it jumps directly from Friday to Monday, in the Forex currencies it shows a candle in Sunday intstead.
10/20/2022 at 11:50 AM #202851 -
AuthorPosts
Find exclusive trading pro-tools on