NexusFi: Find Your Edge


Home Menu

 





Indicator to Plot the OHLC - user selected start/stop times


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 48 posts (61 thanks)
    2. looks_two rfiske with 17 posts (0 thanks)
    3. looks_3 gtichauer with 16 posts (2 thanks)
    4. looks_4 TempletonPeck with 4 posts (0 thanks)
      Best Posters
    1. looks_one Fat Tails with 1.3 thanks per post
    2. looks_two soulartist with 1 thanks per post
    3. looks_3 cory with 0.3 thanks per post
    4. looks_4 gtichauer with 0.1 thanks per post
    1. trending_up 44,758 views
    2. thumb_up 68 thanks given
    3. group 13 followers
    1. forum 105 posts
    2. attach_file 29 attachments




 
 

Indicator to Plot the OHLC - user selected start/stop times

 
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090

thought on forex hours by Kiwi
240 Min / 4 Hour Chart Time-frame Query - [AUTOLINK]Sierra Chart[/AUTOLINK] Support Board


Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Cheap historycal L1 data for stocks
Stocks and ETFs
 
 
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103



FOREX offers several breakout opportunities per day. Depending on the currency pair, it is possible to trade the opening range breakouts: The Asian open, the London open and the New York open. The indicator uses the New York open, as usually the volatility is highest after that open. But for EURUSD you can also trade breakouts from the European Open or for the Aussie a breakout from the Sydney Open would make sense as well.

There is no overlap between New York and Sydney/Tokio. So the FOREX market opens in Asia and closes at 5:00 PM Eastern Time in New York. These are the times used by the indicator.

 
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


This indicator will plot the high and low of the night session. When taken out the indicator continues to plot current day's high and low.

The indicator also has integrated Fibonacci bands for the current day.

Attached Thumbnails
Click image for larger version

Name:	CL 09-10 (5 Min)  03_08_2010.jpg
Views:	484
Size:	102.7 KB
ID:	17908  
Attached Files
Elite Membership required to download: AnaCurrentDayOHLV23.zip
 
 rfiske 
temecula,ca
 
Experience: Advanced
Platform: NT
Broker: AMP/Zen
Trading: Euro
Posts: 46 since May 2010
Thanks Given: 33
Thanks Received: 8


Fat Tails View Post
This indicator will plot the high and low of the night session. When taken out the indicator continues to plot current day's high and low.

The indicator also has integrated Fibonacci bands for the current day.

Many thanks!! - will install and see how it works after market close.

Started this thread
 
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103

Also see indicator under #20. That was the main work, as it automatically plots the opening ranges for a number of futures contracts.

I will add another one, which allows you to plot the European session range. This will be simple, just based on start and end time and plot until the end of the session.



rfiske View Post
Many thanks!! - will install and see how it works after market close.


 
 rfiske 
temecula,ca
 
Experience: Advanced
Platform: NT
Broker: AMP/Zen
Trading: Euro
Posts: 46 since May 2010
Thanks Given: 33
Thanks Received: 8


Fat Tails View Post
As a first answer to your request, I attach an indicator which plots the opening range for various futures contracts. I have done this for my own needs as well. There were four things I wanted to integrate:

(1) Display the open of the RTH session.

(2) If you put the indicator on a chart and then switch instruments, the indicator should automatically select the correct opening period for the instrument. For example the opening period for ES should be 8:30 to 9:30 AM CT, whereas the opening period for 6E should be 8:00 to 9:00 AM ET. This requires that the indicator knows the default values and that you can change them via indicator dialogue.

(3) With ever changing daylight savings times between Europe the US and the rest of the world, the indicator should adapt automatically to these times. So you cannot enter the opening time in your local timezone, but you need to indicate teh session length (close time as per session template - opening time). For example for ES the correct session length would be 15:15 - 8:30 = 6h45, for TF the session length would be 18:00 - 9:30 = 8h30.

(4) Some of the session start at strange times, like the GC session at 8:20 AM, or the SI session at 8:25 AM. If you use larger time frames the data required to calculate the opening range is not included with the chart data base. There will be no bar opening at 8:25 and you cannot display the correct RTH open. This requires to load minute data separately, and calculate the opening range from this data.

(1) to (3) are implemented with the current version, have kept (4) for future improvement.


Default session times based on ETH, opening period based on RTH

FOREX: ETH session 17:00 ET - 17:00 ET, opening period starts 8:00 ET
Currency Futures: ETH session 17:00 CT - 16:00 CT, opening period starts 7:00 CT
DX (Dollar Index): ETH session 20:00 ET - 18:00 ET, opening period starts 8:00 ET
CME Index Futures: ETH session 15:30 CT - 15:15 CT, opening period starts 8:30 CT
TF (Russell 2000): ETH session 20:00 ET - 18:00 ET, opening period starts 9:30 ET
EUREX Index Futures: ETH session 8:00 CET - 22:00 CET, opening period starts 9:00
CBOT Interest Rate Futures: ETH session 17:00 CT - 16:00 CT, opening period starts 8:20 CT
EUREX Interest Rate Futures: ETH session 8:00 - 22:00 CET, opening period starts 8:00
CL (WTI Crude): ETH session 18:00 ET - 17:15 ET, opening period starts 9:00 ET
BC (Brent Crude, ICE): ETH session 20:00 ET - 18:00 ET, opening period starts 9:00 ET
GC (Gold) : ETH session 18:00 ET - 17:15 ET, opening period starts 8:20 ET
SI (Silver): ETH session 18:00 ET - 17:15 ET, opening period starts 8:25 ET
HG (Copper): ETH session 18:00 ET - 17:15 ET, opening period starts 8:10 ET

To catch the correct opening period, you need to enter the difference between session end as per session template and the opening time.

The solution adapted may look complicated, but there are some advantages:

- The indicator will adapt to any chosen template and settings
- You can select the duration of the opening period (for example 5, 15, 30 or 60 minutes)
- You can switch instruments and the opening range will adapt to the instrument
- The opening range will remain correct, when the US has DST for Halloween and Europe is already back to standard time

Feedback welcome.

The 'Opening RangeV23 works great now that i worked through the explanation you sent.

I will try to go into the code and edit the labels and save w/ unique name for the other time periods i wanted - like London & Globex

Started this thread
 
 rfiske 
temecula,ca
 
Experience: Advanced
Platform: NT
Broker: AMP/Zen
Trading: Euro
Posts: 46 since May 2010
Thanks Given: 33
Thanks Received: 8

Fat Tails - Again thanks much for your assistance.

Open RangeV23 as you modified it works great.

I changed the code so I have 3 separate indicators for the 3 time periods I want to plot the High/Low/Mid-point for. Also plots Open with the First Hour Indicator. Globex (3:30PM - 8:30AM CST), London-special (2AM - 5 AM CST), and the First Hour[OR] (8:30AM - 9:30AM CST). I set the correct parameters and unique line attributes for each indicator. The modified Indicators all compiled correctly and plotted/function properly.

However, when I tried to Export the Indicators so I could upload them for anyone else that might be interested in them on futures.io (formerly BMT) forum, I received the Error on the attached.

Couldn't find a solution in the Ninja Help. Any solutions?

Attached Thumbnails
Click image for larger version

Name:	NinjaScript Export Error.jpg
Views:	262
Size:	75.2 KB
ID:	17936  
Started this thread
 
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,662

@rfiske, the fix is simple most likely: check the Control Center - Log tab, it will tell you which indicator was missing -- then you just need to manually add that to your Export list because NT couldn't figure it out on its own.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal
 
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


rfiske View Post

I changed the code so I have 3 separate indicators for the 3 time periods I want to plot the High/Low/Mid-point for. Also plots Open with the First Hour Indicator. Globex (3:30PM - 8:30AM CST), London-special (2AM - 5 AM CST), and the First Hour[OR] (8:30AM - 9:30AM CST). I set the correct parameters and unique line attributes for each indicator. The modified Indicators all compiled correctly and plotted/function properly.

However, when I tried to Export the Indicators so I could upload them for anyone else that might be interested in them on futures.io (formerly BMT) forum, I received the Error on the attached.

Couldn't find a solution in the Ninja Help. Any solutions?

(1) The problem is likely created by the enums. You need to rename the enums to something else and replace them in the whole file.

(2) Also may I ask you not to publish these indicators with the prefix "ana" to avoid confusion. Otherwise we may come to the point, where there are 2 similar indicators with identical names and prefixes. So if you load them up, just select any other prefix, for example name your indicators rfiopeningrange... and then make sure that the three indicators do not use the same names for the enumerations.

 
 rfiske 
temecula,ca
 
Experience: Advanced
Platform: NT
Broker: AMP/Zen
Trading: Euro
Posts: 46 since May 2010
Thanks Given: 33
Thanks Received: 8


I will certainly rename them as you suggested. That assumes I can figure out / learn what the enums are. I will read more about the code as I have never even open a file previously. I'm learning a lot - maybe more than I wanted. - LOL

Started this thread

 



Last Updated on October 14, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts