Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Today Daily Range
 Post subject: Today Daily Range Post rating: 0   New post Posted: Mon 01 Feb, 2016, 19:00 
User avatar

User rating: 0
Joined: Wed 10 Jul, 2013, 12:42
Posts: 30
Location: FranceFrance
Hello
I am starting to learn JForex, working my way through Youtube instructional videos. I want to start designing simple strategies but I am running into a topic which I haven't been able to find on the forum. Today Daily Range

Perhaps I am asking too early in my learning curve, but as part of a strategy I would like only commence if the current daily range is at least a certain size, eg 50 pips, to keep the strategy from activating trade entry conditions in periods of low volatility, ie typical Asian session or into a low volatility Euro session and so forth.
I could not find any pre-built TDR like I have on MT4/5, so I guess I will have to build one.

If we define the day starting at GMT 2100, I need to calculate the highest-high and lowest-low since this period, running this through the day, subtracting the low from the high to get the range, until it resets to 0 at the next GMT 2100.

From this thread I have a glimpse of an idea how it may be achieved: https://www.dukascopy.com/swiss/english ... nge#p84892

I see a Highest-High to Lowest Low counter for 5 bars, but how add to this bar counter, so that working from a default period of M15, the counter for bars starts at 0, then 1 after 2115, 2 after 2130 up to 95 bars in the new days 2045?
Then I can subtract lowest low from highest high to get the current daily range (up to the last M15 bar at least), then an IF statement that if TDR > 50 then proceed.

Can someone let me know if I am on the right track, and any tips on the bar counter, but also let me know if this is the most efficient way to achieve the result or is there a better one?

Thanks
LiamsDad


 
 Post subject: Re: Today Daily Range Post rating: 0   New post Posted: Fri 12 Feb, 2016, 12:04 
User avatar

User rating: 0
Joined: Wed 10 Jul, 2013, 12:42
Posts: 30
Location: FranceFrance
Hello
I have solved this problem in a much more uncomplicated manner than I guessed at above, using Get historical candle Daily set to day 0, and assigning Daily Candle Candle High to the value of Max_today and Daily Candle Candle Low to Min_Today, subtracting Min_today from Max_today to output to variable TodayDailyRange.

What I have to do next is compare the result of TodayDailyRange to a variable MinRangeforStrategy of 0.0050 and if greater then proceed.
So far when I put in this If TodayDailyRange > MinRangeforStrategy statement running on tick historical backtest seems to stop operating - so if anyone is reading this and knows a fix, please post a reply.

Regards
LD


 
 Post subject: Re: Today Daily Range Post rating: 0   New post Posted: Wed 01 Nov, 2017, 22:15 
User avatar

User rating: 0
Joined: Fri 17 Jan, 2014, 18:13
Posts: 72
Location: NetherlandsNetherlands
Nice and simple idea. Thanks.


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com