Indicator to Plot the OHLC - user selected start/stop times - NinjaTrader Programming | futures io social day trading
futures io futures trading


Indicator to Plot the OHLC - user selected start/stop times
Updated: Views / Replies:22,404 / 105
Created: by rfiske Attachments:30

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 30  
 
Thread Tools Search this Thread
 

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

  #71 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,600 received
Forum Reputation: Legendary


gtichauer View Post
FT,

Now working perfect on historical data....will check Monday on Real time. or weekend on replay....two comments:
- do I have to change anything as I did with prev version to plot OR high/low since they are defined (remaining fixed) instead of since the opening and moving until they are finally defined?

- with prev version I edited and changed the names to IB High/Low and o/n High/low but in this case it is not working? can u guide me how to do this?

thanks again !!!

Define session template with multi-sessions. Then select the session (first, second or third) to which you want to apply the opening range. Select opening range duration.

You will need to rename the following lines:

for OR-High, OR-Low and OR-mid lines 114-116

 
Code
 
Add(new Plot(new Pen(Color.Goldenrod,1), PlotStyle.Line,"OR-High"));
Add(new Plot(new Pen(Color.Goldenrod,1), PlotStyle.Line,"OR-Low"));
Add(new Plot(new Pen(Color.Goldenrod,1), PlotStyle.Line,"OR-Mid"));

for Pre-High and Pre-Low lines 117-118
 
Code
 
Add(new Plot(new Pen(Color.White,1), PlotStyle.Line,"Pre-High"));
Add(new Plot(new Pen(Color.White,1), PlotStyle.Line,"Pre-Low"));
and line 781
 
Code
 
if (european && !ignoreEuropean && ( plot.Name == "Pre-High" || plot.Name == "Pre-Low"))
and also lines 820-827 (see below)


for AS-High, AS-Low, EU-High and EU-Low lines 820-827
 
Code
 
if (asian && !ignoreAsian && plot.Name == "Pre-High")
plotString = "AS-High";
else if (asian && !ignoreAsian && plot.Name == "Pre-Low")
plotString = "AS-Low";
else if (european && !ignoreEuropean && plot.Name == "Pre-High")
plotString = "EU-High";
else if (european && !ignoreEuropean && plot.Name == "Pre-Low")
plotString = "EU-Low";

Reply With Quote
 
  #72 (permalink)
Elite Member
Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen Fire / IB
Favorite Futures: ES, TF, 6E, CL
 
gtichauer's Avatar
 
Posts: 379 since Jul 2009
Thanks: 807 given, 296 received


Fat Tails View Post
Define session template with multi-sessions. Then select the session (first, second or third) to which you want to apply the opening range. Select opening range duration.

You will need to rename the following lines:

for OR-High, OR-Low and OR-mid lines 114-116

 
Code
 
Add(new Plot(new Pen(Color.Goldenrod,1), PlotStyle.Line,"OR-High"));
Add(new Plot(new Pen(Color.Goldenrod,1), PlotStyle.Line,"OR-Low"));
Add(new Plot(new Pen(Color.Goldenrod,1), PlotStyle.Line,"OR-Mid"));

for Pre-High and Pre-Low lines 117-118
 
Code
 
Add(new Plot(new Pen(Color.White,1), PlotStyle.Line,"Pre-High"));
Add(new Plot(new Pen(Color.White,1), PlotStyle.Line,"Pre-Low"));
and line 781
 
Code
 
if (european && !ignoreEuropean && ( plot.Name == "Pre-High" || plot.Name == "Pre-Low"))
and also lines 820-827 (see below)


for AS-High, AS-Low, EU-High and EU-Low lines 820-827
 
Code
 
if (asian && !ignoreAsian && plot.Name == "Pre-High")
plotString = "AS-High";
else if (asian && !ignoreAsian && plot.Name == "Pre-Low")
plotString = "AS-Low";
else if (european && !ignoreEuropean && plot.Name == "Pre-High")
plotString = "EU-High";
else if (european && !ignoreEuropean && plot.Name == "Pre-Low")
plotString = "EU-Low";

FT,

I am sorry to say that I changed every line of code u mention and don't know why or how but it keeps showing the original labels.....I deleted the file, reinstalled it and same issue.......one comment to mention.....the first time I installed it I changed colors and press right button and SET DEFAULT for those parameters......AFTER THAT I deleted and reinstalled and the parameters by default were the LAST ONES I modified, NOT the ones from your original version (which I would expect IF I deleted and reinstalled)......any idea what may be happening that I can not change the plots?

also run on replay and as previous versions it start plotting since the opening.....u told me before to modify one line to change this .....see below
- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -
(1) Modify line 324 of the indicator to

 
Code
 
if (plotOHL && sessionOpen && Time[0] > sessionEnd.Subtract(sessionLength-openingPeriod))
and it will only start plotting the opening range after the opening period is complete. The opening range will be shown starting from the open.
- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -

But this has changed now.....I should be changing some other line I believe....can u guide me pls?

GT
Reply With Quote
 
  #73 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,600 received
Forum Reputation: Legendary



gtichauer View Post
FT,

I am sorry to say that I changed every line of code u mention and don't know why or how but it keeps showing the original labels.....I deleted the file, reinstalled it and same issue.......one comment to mention.....the first time I installed it I changed colors and press right button and SET DEFAULT for those parameters......AFTER THAT I deleted and reinstalled and the parameters by default were the LAST ONES I modified, NOT the ones from your original version (which I would expect IF I deleted and reinstalled)......any idea what may be happening that I can not change the plots?

also run on replay and as previous versions it start plotting since the opening.....u told me before to modify one line to change this .....see below
- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -
(1) Modify line 324 of the indicator to

 
Code
 
if (plotOHL && sessionOpen && Time[0] > sessionEnd.Subtract(sessionLength-openingPeriod))
and it will only start plotting the opening range after the opening period is complete. The opening range will be shown starting from the open.
- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -

But this has changed now.....I should be changing some other line I believe....can u guide me pls?

(1) To change the label lines: Edit indicator via Tools -> Edit Ninjajscript -> Indicator. Then change the code. Press F5 to compile and you are done.

(2) Change line 404 to

 
Code
 
if (plotOHL && initOpeningRange && Time[0] >= sessionStartTime.Add(openingPeriod))
The indicator will now start plotting the opening range, when complete but plot the line back to where it started.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #74 (permalink)
Elite Member
Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen Fire / IB
Favorite Futures: ES, TF, 6E, CL
 
gtichauer's Avatar
 
Posts: 379 since Jul 2009
Thanks: 807 given, 296 received


Fat Tails View Post
(1) To change the label lines: Edit indicator via Tools -> Edit Ninjajscript -> Indicator. Then change the code. Press F5 to compile and you are done.

(2) Change line 404 to

 
Code
 
if (plotOHL && initOpeningRange && Time[0] >= sessionStartTime.Add(openingPeriod))
The indicator will now start plotting the opening range, when complete but plot the line back to where it started.

(1) that is exactly what I did.....moreover I did it with success in the prev versions.....
(2) will do this later...now from cell phone....thanks !!

GT
Reply With Quote
 
  #75 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,600 received
Forum Reputation: Legendary

If you are lazy, you can just edit the indicator and use the Find/Replace option. That will do in any case, and you do not need to search the file. Just put in your preferred label, select Match case and then Replace All.

See below.

Attached Thumbnails
Indicator to Plot the OHLC - user selected start/stop times-lazy.jpg  
Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #76 (permalink)
Elite Member
Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen Fire / IB
Favorite Futures: ES, TF, 6E, CL
 
gtichauer's Avatar
 
Posts: 379 since Jul 2009
Thanks: 807 given, 296 received


Fat Tails View Post
If you are lazy, you can just edit the indicator and use the Find/Replace option. That will do in any case, and you do not need to search the file. Just put in your preferred label, select Match case and then Replace All.

See below.

Will try this tomorrow.....thanks !!!

GT
Reply With Quote
 
  #77 (permalink)
Elite Member
Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen Fire / IB
Favorite Futures: ES, TF, 6E, CL
 
gtichauer's Avatar
 
Posts: 379 since Jul 2009
Thanks: 807 given, 296 received


Fat Tails View Post
(1) To change the label lines: Edit indicator via Tools -> Edit Ninjajscript -> Indicator. Then change the code. Press F5 to compile and you are done.

(2) Change line 404 to

 
Code
 
if (plotOHL && initOpeningRange && Time[0] >= sessionStartTime.Add(openingPeriod))
The indicator will now start plotting the opening range, when complete but plot the line back to where it started.

(2) worked great......still fighting with (1).....not being able to change the labels on this one....tried the Find and Replace also....quite strange....will check it tomorrow again and share.....thanks !!!

GT
Reply With Quote
 
  #78 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,600 received
Forum Reputation: Legendary


gtichauer View Post
......still fighting with (1).....

Then go and fight again....

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #79 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,600 received
Forum Reputation: Legendary

Small bug in test version

While the indicator from post #64 looks correct, the indicator Test2OpeningRangeV28 from post #68, which I had modified for older versions of NT7 has a small bug. I have replaced it with Test3OpeningRangeV28, which should run correctly.

Details: It was a typical copy-and-paste bug. If you have already installed the indicator, just replace line 765

 
Code
 
Bars.Session.GetNextBeginEnd(Time[0], out thisSessionBegin, out thisSessionEnd);
with

 
Code
 
Bars.Session.GetNextBeginEnd(barTime, out thisSessionBegin, out thisSessionEnd);
Due to the bug, the opening range lines can be drawn back into the prior session.


Last edited by Fat Tails; September 12th, 2010 at 06:52 PM.
Reply With Quote
 
  #80 (permalink)
Elite Member
Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen Fire / IB
Favorite Futures: ES, TF, 6E, CL
 
gtichauer's Avatar
 
Posts: 379 since Jul 2009
Thanks: 807 given, 296 received



Fat Tails View Post
Then go and fight again....

FT,

is there something u think I may have in memory that I should manually delete that could be causing renamed labels not to be reflected?

As I told u, I change the colors of the lines, press right mouse button and save as default, but even if I delete the indi, imported again, IT DOES NOT SHOW ORIGINAL COLORS, it remains with the ones I changed......(¿if I delete the indi and reinstall shouldn't it be as the original?)......this is what lead me to believe something is happening on the back....I reintstall four times and no way to change the labels....I also tested the first V28 version for b21 only and the same....
any thoughts?

ZTR told me there was some way of using the output window to check if the code was doing what it was meant to do and do some kind of test.....he went to hospital so we could not skype to check this....any idea what was this?

Thanks,

GT
Reply With Quote

Reply



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

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trading Times Indicator Doppio NinjaTrader 7 May 20th, 2016 02:11 PM
Bar Type with User controlled start times DavidHP NinjaTrader 0 May 30th, 2011 11:42 AM
NinjaTrader indicator to shade times on a chart tradersteph The Elite Circle 3 March 5th, 2010 07:05 PM
OHLC calculations indicator vast NinjaTrader Programming 3 January 16th, 2010 06:43 AM
OHLC with optional session times carlos NinjaTrader Programming 1 September 21st, 2009 08:37 AM


All times are GMT -4. The time now is 10:50 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-11 in 0.16 seconds with 20 queries on phoenix via your IP 54.145.16.43