NexusFi: Find Your Edge


Home Menu

 





"Opening" bar of an indicator


Discussion in NinjaTrader

Updated
    1. trending_up 2,005 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 2 attachments




 
Search this Thread

"Opening" bar of an indicator

  #1 (permalink)
 
patbateman's Avatar
 patbateman 
NY, NY
 
Experience: None
Platform: T4, NinjaTrader
Trading: All!
Posts: 235 since Mar 2012
Thanks Given: 113
Thanks Received: 200

Hello, I'm trying to find a way to bring up the "bar" of an indicator at a specific time.

For example, the value of volume at 9:30 eastern.

CurrentDayOHL won't work, and it looks like FatTails superior OHL won't either.

"A Jedi's strength flows from the force."
-Yoda
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quant vue
Trading Reviews and Vendors
MC PL editor upgrade
MultiCharts
 
  #2 (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

something likes this?



Syntax
Bars.GetBar(DateTime time)


Parameters
time
Time stamp to be converted to a bar index


Examples
// Check that its past 9:45 AM
if (ToTime(Time[0]) >= ToTime(9, 45, 00))
{
// Calculate the bars ago value for the 9 AM bar for the current day
int barsAgo = CurrentBar - Bars.GetBar(new DateTime(2006, 12, 18, 9, 0, 0));

// Print out the 9 AM bar closing price
Print("The close price on the 9 AM bar was: " + Close[barsAgo].ToString());
}

Reply With Quote
  #3 (permalink)
 
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



patbateman View Post
Hello, I'm trying to find a way to bring up the "bar" of an indicator at a specific time.

For example, the value of volume at 9:30 eastern.

CurrentDayOHL won't work, and it looks like FatTails superior OHL won't either.


Could you please explain what you want to bring up and how you want to display it?

Obviously OHLC will not work, because those values are directly taken from the instrument.

Reply With Quote
  #4 (permalink)
 
patbateman's Avatar
 patbateman 
NY, NY
 
Experience: None
Platform: T4, NinjaTrader
Trading: All!
Posts: 235 since Mar 2012
Thanks Given: 113
Thanks Received: 200

Plotting an SMA of volume on a futures ETH chart is useless, because it picks up the globex session. I'm trying to figure a way to compare volume to the average volume of that point in time. Example, a 9:30 volume bar to every other 9:30 volume bar since 2010.

I was thinking on using OHL somehow, but I suppose there are better methods. Maybe something already exists that I'm missing?

Any thoughts and I'll pitch in. This is definitely useful and I think others will use it too.

"A Jedi's strength flows from the force."
-Yoda
Started this thread Reply With Quote
  #5 (permalink)
 
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


patbateman View Post
Plotting an SMA of volume on a futures ETH chart is useless, because it picks up the globex session. I'm trying to figure a way to compare volume to the average volume of that point in time. Example, a 9:30 volume bar to every other 9:30 volume bar since 2010.

I was thinking on using OHL somehow, but I suppose there are better methods. Maybe something already exists that I'm missing?

Any thoughts and I'll pitch in. This is definitely useful and I think others will use it too.


I have coded an indicator which compares the volume of the current bar to the volume of all previous bars with the same day of week and the same time stamp. With default settings, it would compare the volume of today's 1:00 PM bar to the average volume of the 1:00 PM bars of the preceding 20 Fridays. The indicator will

- The indicator will display the relative volume compared to the average.
- Any value below 80% (threshold selectable) will be plotted red.
- Any value between 80% and 120% (thresholds selectable) will be plotted white.
- Any value above 120% (threshold selectable) will be plotted green.
- Specific dates (holidays or crash days) can be excluded from the average.
- The indicator also displays the cumulated value of the relative volume for the entire trading day.
- The indicator deals with daylight savings issues.

Below you will see that today's volume was only 58% of the average volume of the last 20 Fridays. There were only two exciting bars with a high relative volume

- one was a doji at 0:30 - 0:45 EST
- the other one was the bar prior to the regular open from 9:15 to 9:30 EST

Here is a link to the indicator:





Reply With Quote
Thanked by:
  #6 (permalink)
 
patbateman's Avatar
 patbateman 
NY, NY
 
Experience: None
Platform: T4, NinjaTrader
Trading: All!
Posts: 235 since Mar 2012
Thanks Given: 113
Thanks Received: 200


Fat Tails View Post
I have coded an indicator which compares the volume of the current bar to the volume of all previous bars with the same day of week and the same time stamp. With default settings, it would compare the volume of today's 1:00 PM bar to the average volume of the 1:00 PM bars of the preceding 20 Fridays. The indicator will

- The indicator will display the relative volume compared to the average.
- Any value below 80% (threshold selectable) will be plotted red.
- Any value between 80% and 120% (thresholds selectable) will be plotted white.
- Any value above 120% (threshold selectable) will be plotted green.
- Specific dates (holidays or crash days) can be excluded from the average.
- The indicator also displays the cumulated value of the relative volume for the entire trading day.
- The indicator deals with daylight savings issues.

Below you will see that today's volume was only 58% of the average volume of the last 20 Fridays. There were only two exciting bars with a high relative volume

- one was a doji at 0:30 - 0:45 EST
- the other one was the bar prior to the regular open from 9:15 to 9:30 EST

Here is a link to the indicator:





Amazing! I'll definitely add it and tell others to join the EC, many thanks.

"A Jedi's strength flows from the force."
-Yoda
Started this thread Reply With Quote
  #7 (permalink)
 
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

If you want to compare the volume since the beginning of 2010, then you would need to increase the lookback period of the chart to 365 + 365 + 230 = 960 days or more and set the number of weeks referenced to 52 + 52 + 32 /* current week of year - 1 */ = 136. It will then compare today's volume to the last 136 weeks.

See chart attached.

The indicator is not one of the most recent ones, so I would need to update it.



Reply With Quote
Thanked by:




Last Updated on August 17, 2012


© 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