NexusFi: Find Your Edge


Home Menu

 





Requesting basic OHLC indicator.


Discussion in NinjaTrader

Updated
    1. trending_up 8,325 views
    2. thumb_up 16 thanks given
    3. group 2 followers
    1. forum 30 posts
    2. attach_file 16 attachments




 
Search this Thread

Requesting basic OHLC indicator.

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


LaissezFaire View Post
That's very odd. I just tried rebooting and that didn't help either.

Anyway, your screenshot is pretty much exactly what I had in mind, so...

something wrong with data probl due to DST, change it to loading 10 days, and reload all history data.

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures True Range Report
The Elite Circle
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
  #12 (permalink)
LaissezFaire
Oslo + Norway
 
Posts: 224 since May 2016
Thanks Given: 224
Thanks Received: 104


cory View Post
something wrong with data probl due to DST, change it to loading 10 days, and reload all history data.

Appreciate your efforts, cory, but it didn't work...

Reply With Quote
  #13 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,344
Thanks Received: 26,267


@cory, FYI, I imported your zip and got this log error when I ran it:

"Error on calling 'OnBarUpdate' method on bar 0. You are accessing an index with a value that is invalid since it is out-of-range"

(I hate those .)

I didn't debug it further.

Hope this is a clue.

Bob.

Reply With Quote
Thanked by:
  #14 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


bobwest View Post
@cory, FYI, I imported your zip and got this log error when I ran it:

"Error on calling 'OnBarUpdate' method on bar 0. You are accessing an index with a value that is invalid since it is out-of-range"

(I hate those .)

I didn't debug it further.

Hope this is a clue.

Bob.

Note: time format is HH:MM, ignore the first day value, try to use 1 of Ninja session making sure it works before using your own customize session.

Attached Files
Elite Membership required to download: NT8_CurrentOHLC.zip
Reply With Quote
Thanked by:
  #15 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,344
Thanks Received: 26,267


cory View Post
Note: time format is HH:MM, ignore the first day value, try to use 1 of Ninja session making sure it works before using your own customize session.

Here it is:




Looks pretty good.

Notes:

It seems to ignore the "Start Time" parameter, as well as "use start time instead" -- I tried fiddling with both, no difference. It started the time lines at the session break, which frankly is what makes the most sense, no matter the Start Time setting. (This chart is ETH: <use instrument settings> for trading hours, so the session breaks at 17:00 EDT. The vertical red line on the chart is the start of the NY session for ES at 9:30 AM EDT. )

It worked the same when the chart is set to RTH trading hours: it broke on the session breaks, starting the day at 9:30 EDT in this case, as expected.

If it were me, I would say that's good enough, since you would probably only want the current day OHLC for the current chart day (), based on how you had the chart session set up. But it's not necessarily up to me.

It also took a long time to load. Putting it on a 1-minute chart with just a few days on it (10) was OK. With a large number of days it took forever. With fewer bars on the chart, it loads up OK. It also seems to need to be always set to the default of Calculate on Bar Close, which means the last price level is as of the prior bar's close -- the last completed bar. When set to either on each tick or on price change there were strange effects. (You'd have to test it to see them.) But at the default setting of On Bar Close it works. Again, not my call.

Note to @LaissezFaire, the indicator shows in your indicator list as "CurrentOHLC".

Bob.

Reply With Quote
  #16 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


bobwest View Post
Here it is:


It seems to ignore the "Start Time" parameter, as well as "use start time instead" --

see pics


Quoting 
...
It also took a long time to load.

Bob.

yes, because it re-draw the whole chart.

Attached Thumbnails
Click image for larger version

Name:	2018-03-12_1325.png
Views:	231
Size:	133.5 KB
ID:	247603   Click image for larger version

Name:	2018-03-12_1324.png
Views:	207
Size:	160.0 KB
ID:	247604  
Reply With Quote
  #17 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,344
Thanks Received: 26,267


cory View Post
see pics

You're right. I didn't look as closely as I should have.


Quoting 
yes, because it re-draw the whole chart.

Also right.



Bob.

Reply With Quote
  #18 (permalink)
LaissezFaire
Oslo + Norway
 
Posts: 224 since May 2016
Thanks Given: 224
Thanks Received: 104


cory View Post
Note: time format is HH:MM, ignore the first day value, try to use 1 of Ninja session making sure it works before using your own customize session.

Works great, cory! Thank you so much!

Would it be possible to...

1. Color code the high/low based on whether the day low or high comes first on the day...?

Example:

If day low comes before the day high = green lines for high and low

If day high comes before the day low = red lines for high and low

2. Have the extension lines at the end extend only to the end of session at 16:00?

Or otherwise plot a vertical line to show where the session will end?

3. Include the prior day close as a horizontal line on the current day also...?

This may be an involved task and I'm certainly not asking/expecting you to do it, but I figured I could ask. If you do paid work, I could pay you for it.

Thanks again!

Reply With Quote
  #19 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


LaissezFaire View Post
Works great, cory! Thank you so much!

Would it be possible to...

1. Color code the high/low based on whether the day low or high comes first on the day...?

Example:

If day low comes before the day high = green lines for high and low

If day high comes before the day low = red lines for high and low

done.


Quoting 
2. Have the extension lines at the end extend only to the end of session at 16:00?

Or otherwise plot a vertical line to show where the session will end?

there is time zone indicator to color session start to end


Quoting 
3. Include the prior day close as a horizontal line on the current day also...?

This may be an involved task and I'm certainly not asking/expecting you to do it, but I figured I could ask. If you do paid work, I could pay you for it.

Thanks again!

there is indicator to plot prev close

Attached Files
Elite Membership required to download: CurrentOHLC.cs
Reply With Quote
Thanked by:
  #20 (permalink)
LaissezFaire
Oslo + Norway
 
Posts: 224 since May 2016
Thanks Given: 224
Thanks Received: 104


Thanks a lot, cory!

However, I'm getting similar issues to last time when only using a *.cs file to add the indicator... Seems like I need a zip if that's not too much trouble.

Reply With Quote




Last Updated on April 22, 2018


© 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