How to programatically get value of Camarilla pivots from anaPivotZones indicator? - NinjaTrader Programming | futures io social day trading
futures io futures trading


How to programatically get value of Camarilla pivots from anaPivotZones indicator?
Updated: Views / Replies:2,553 / 8
Created: by approx Attachments:5

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
 
Thread Tools Search this Thread
 

How to programatically get value of Camarilla pivots from anaPivotZones indicator?

  #1 (permalink)
Elite Member
mountain view, ca
 
Futures Experience: Intermediate
Platform: multicharts, NT
Favorite Futures: 6E
 
Posts: 17 since Sep 2011
Thanks: 26 given, 3 received

How to programatically get value of Camarilla pivots from anaPivotZones indicator?

I have a hopefully straighforward question.

In NT strategy code, using Fat Tail's Pivot Zones indicator, how do I programatically get value for the various Camarilla pivot zones - R1High, R1Low, PPHigh, PPLow etc?
I can seem to plot it fine, but when I try to retrieve the values (for example, of R1High) progamatically in OnBarUpdate method, it gives me an error on the chart saying "no data found. Please reload daily data or use calcFromIntradayData"...


 
Code
 
private anaPivotZonesDailyV38 mycamarilla = null;
 
protectedoverridevoid Initialize()
{
mycamarilla = anaPivotZonesDailyV38(anaSessionCountPZD38.Second,anaPivotStylesPZD38.Camarilla,anaSessionTypePZD38.Custom,HLCCalculationMode.DailyBars,false,0,0,0); 
 
Add(mycamarilla);
}
 
protectedoverridevoid OnBarUpdate()
{
double R1High = mycamarilla.R1High[0];
}

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

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


All pivot indicators - this includes the default pivot indicators supplied with NinjaTrader - load daily data asynchronously. If you access the pivots indicator in DailyBars mode, this asynchronous loading of daily data will not work.


This has been confirmed by NinjaTrader support, and you will find various threads on this subject in the Ninjatrader forum.


As a consequence you can only programmatically access the pivot indicators in CalcFromIntradayDatamode. I have attached a model indicator, which accesses the default pivots indicator of NinjaTrader. If you set it to DailyBars, it will display nothing. You need to set it to CalcFromIntradayData


An alternative way of loading daily data would be to use the Add() method. However, the heuristic used by NinjaTrader to add daily bars is flawed, so they will not be inserted at the correct place for all types of session templates. I have therefore not coded a pivots indicator, which use the Add() method.


Do not hesitate to come back, if you have any further questions.

Attached Files
Register to download File Type: zip PivotsAccess.zip (7.5 KB, 75 views)
Reply With Quote
The following 4 users say Thank You to Fat Tails for this post:
 
  #4 (permalink)
Elite Member
mountain view, ca
 
Futures Experience: Intermediate
Platform: multicharts, NT
Favorite Futures: 6E
 
Posts: 17 since Sep 2011
Thanks: 26 given, 3 received

Thanks for your reply Fattails.

So, I tried changing Calculation Mode from DailyBars to CalcFromIntradayData, and you're right, I can access the Pivot info programatically.
However, the pivot values calculated using Dailybars vs CalcFromIntradayData seem way off. For example, R4High using dailybars is 1.2754 while, it is 1.2739 when using CalcFromIntradayData. Hmmm...



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


approx View Post
Thanks for your reply Fattails.

So, I tried changing Calculation Mode from DailyBars to CalcFromIntradayData, and you're right, I can access the Pivot info programatically.
However, the pivot values calculated using Dailybars vs CalcFromIntradayData seem way off. For example, R4High using dailybars is 1.2754 while, it is 1.2739 when using CalcFromIntradayData. Hmmm...


If the highs are different, it shows that you use a false session template. Highs and lows should be the same for daily data and intraday data, if an appropriate session template is used.

The only short coming of intraday data is that you cannot use the settlement price for futures. The settlement price cannot be retrieved from any intraday chart, because the information is simply not available. So you are limited to the use of the last traded price of the selected session.

Your high or low problem can be easily solved. Best you post a chart with the indicator applied and I will comment on it.

Reply With Quote
 
  #6 (permalink)
Elite Member
mountain view, ca
 
Futures Experience: Intermediate
Platform: multicharts, NT
Favorite Futures: 6E
 
Posts: 17 since Sep 2011
Thanks: 26 given, 3 received

Hi FatTails,
I have attached the two screenshots. 1st is using DailyBars. 2nd is using CalcFromIntraday..
In the Dataseries for 6e, I have specified session template as "CME FX Futures ETH" - not sure if this is correct..

Attached Thumbnails
How to programatically get value of Camarilla pivots from anaPivotZones indicator?-6e-03-12-4-range-1_11_2012_dailybars.jpg   How to programatically get value of Camarilla pivots from anaPivotZones indicator?-6e-03-12-4-range-1_11_2012_calcintrabar.jpg  
Reply With Quote
 
  #7 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,652 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


approx View Post
Hi FatTails,
I have attached the two screenshots. 1st is using DailyBars. 2nd is using CalcFromIntraday..
In the Dataseries for 6e, I have specified session template as "CME FX Futures ETH" - not sure if this is correct..

Your templates are correct. The Camarilla pivots are calculated from prior day's high, low and close. In DailyBars the close is the settlement price (1.2700), whereas in CalcFromIntradayData mode it is the last traded price (1.2712).

The difference of 12 pips affects all Camarilla pivots. For example the level for R4 will be 1.2772 calculated from the settlement price, but 1.2784 calculated from the last traded price.

Also please update the indicator. Although I did not change the version number, I have made a few changes to the indicator

-> holidays entered for 2012
-> bug removed (one of the levels did not plot as range but as line, only affected Camarilla pivots)
-> bug removed (levels Y-PRL and Y-Mid, only affected Camarilla pivots)
-> 5th level added

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #8 (permalink)
Elite Member
mountain view, ca
 
Futures Experience: Intermediate
Platform: multicharts, NT
Favorite Futures: 6E
 
Posts: 17 since Sep 2011
Thanks: 26 given, 3 received

Thanks. I will download the latest indicator.

So then it seems the way to get accurate camarilla pivot values that uses settlement prices would be to Add a second dataseries (daily) to the strategy and use that second dataseries in the pivots indicator...

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


approx View Post
Thanks. I will download the latest indicator.

So then it seems the way to get accurate camarilla pivot values that uses settlement prices would be to Add a second dataseries (daily) to the strategy and use that second dataseries in the pivots indicator...

I have not yet found a satisfactory solution. I personally use segmented session templates for 6E which divide the session into 3 segments, as some of my indicators use the opening range and/or the volatility of a specific session.

The problem with daily data is that NinjaTrader does not add it at the beginning of the trading day, but in some cases earlier (with hindsight knowledge) and in some cases later, as shown in the chart below. So I do not trust in adding data synchronously via the Add() method.

That is the reason that the pivots indicator loads it asynchronously by using a cache.

You maybe more lucky if you use an ETH template.

Attached Thumbnails
How to programatically get value of Camarilla pivots from anaPivotZones indicator?-6e-03-12-15-min-13_01_2012.jpg  
Attached Files
Register to download File Type: zip PriorDaySettlementSync.zip (1.8 KB, 48 views)
Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:

Reply



futures io > > > > > How to programatically get value of Camarilla pivots from anaPivotZones indicator?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camarilla Pivot Indicator for Multicharts -- 6e futures approx MultiCharts 21 March 1st, 2015 09:36 AM
Export history of pivots from PriceActionSwing indicator? GaryD NinjaTrader Programming 5 December 31st, 2011 07:57 PM
Camarilla Pivots Level 5 ? Gabriyele The Elite Circle 36 December 1st, 2011 09:19 AM
NT Indicator to plot Floor Trader Pivots historically on Intraday data? drmartell The Elite Circle 2 December 5th, 2010 04:21 PM
GREAT PIVOT(All level-mid-floor-camarilla) INDICATOR astrading NinjaTrader Programming 4 June 20th, 2010 09:10 AM


All times are GMT -4. The time now is 04:26 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-13 in 0.15 seconds with 20 queries on phoenix via your IP 54.90.92.204