Hi Fattails, just want to say a big thank you for creating this fantastic thread! I am hoping you can help me solve this terrible headache of mine! I am building an automated FX trading strategy with pivots at the core, and I have been tearing my hair out every day trying to get Floor Pivots to work properly on Ninjatrader. The problem is that there are so many moving parts!
My strategy seeks to do this: When the price comes within 10 pips of a Pivot Resistance level (along with confirmation from some other trending conditions), I sell. When the price comes within 10 pips of a Pivot Support level (along with confirmation), I buy. I don't trade off the central pivot at all.
How I tried to do this: I sought to do this by specifying a 20 pip range within the price must lie (using the condition builder). You can see in my strategy that in condition sets 6,7 and 8 (for trading Resistances R1, R2 and R3), I have specified that Price < Rn + 10 ticks and Price > Rn - 10 ticks as conditions (using the offset parameter). The desired effect of these two conditions was to create a trade condition which would be met if the price lay within 10 pips on either side of the relevant pivot. I have done the same in condition sets 1, 2 and 3 for trading Supports.
The problem: I ran the strategy today, and got fills at levels ridiculously far from the pivots. My strategy seems to completely ignore the pivot levels calculated, although it sticks stringently to all my other conditions. I have no idea how this works! Can you see any reason why my pivot conditions are being ignored?
My Hypothesis 1: Barchart quotes prices in tenthpips, and hence each tick is 0.1 pips. To define a 10 pip band above and below the pivot, I set the offset value to 100 ticks and -100 ticks respectively. However, I've tried other offset methods such as percentage offsets with a 0.0004% offset, which amounts to about 5pips on EURUSD. And the strategy still trades far off the pivots. Hence, I don't think this is the problem, but I'm just listing down all the possibilities.
My Hypothesis 2: I am paying $60 a month for a Barchart datafeed which I hook up to NT7. Barchart provides daily data, and the strange thing is that my chart displays pivot values perfectly! Thus, it appears that the pivots showing on my charts are different from the pivots calculated in the strategy. However, I have already taken all precautions against that happening by specifying the same session convention in the chart and in my strategy (FOREX)! It seems as though the data is being ignored by my strategy, which sticks obediently to all my other conditions except the pivots. I have no idea how this is possible! Does the problem lie in the pivot indicator provided by Ninjatrader, and is there a better, bug-free indicator which I can use?
My Hypothesis 3: Ninjatrader's Pivot Indicator calculates only on bar close, while my strategy updates per tick. However, my knowledge of how NT works is very skimpy, and I'm not sure how this works.
My Hypothesis 4: I live on the Pacific Rim, at GMT +8. This is generally 12 hours ahead of New York, and 11 hours ahead of New York during daylight saving time. The close of each FX trading day, by convention, is 5pm EST. Is the time configuration on my computer important in getting Ninjatrader to work? Do I need to adjust my computer's internal clock to Eastern Standard time to ensure that Pivots work correctly?
Also, does the PC's time automatically adjust itself daylight saving time, or would I have to make that adjustment myself when DST kicks in? It's a huge mess!
My Plea: Could some kind soul take a look at this strategy and shed some light on my problem? It's killing me trying to get my strategy to adhere to the daily pivots!!!
The following 2 users say Thank You to skyholder84 for this post:
sounds like you have some fun. Before dealing with the different ideas, please note, that there is a NinjaTrader bug. Pivots cannot be correctly accessed in Dailybars mode via another strategy or indicator. I am currently trying to get a response from support to that problem.
I suggest that you use the pivots in CalcFromIntradayData mode only. Now, if these are the wrong pivots, I might modify my indicator and edit a special version that does not require DailyBars. Do you use your strategy on minute charts, tick charts? What are your session times and which is the close that you chose?
Hypothesis 1: You need to configure NT7 under Tools -> Options -> Data -> Quote currencies (FX) in to comply with the Barchart data feed.
Hypothesis 2: Yes, your data is ignored, because the Pivot values cannot be accessed in DailyBars mode.
Hypothesis 3: Should not be a problem.
Hypothesis 4: One of the NinjaScript methods did not work correctly until version NT 184.108.40.206. You must use NT 220.127.116.11 or later. I have never set my PC to GMT +8, but if your chart is correct, the strategy should also run correctly, as it uses the same sessions.
NinjaTrader 7.0 is based on .NET framework 3.5. The adjustment of daylight savings times should be done automatically, as the sessions adapt to the various DST zones. This is one of the advantages of NT 7.0 versus NT 6.5. So there should be no issues.
It is code I created a long time ago for a Murrey Math strategy. It is Elite only. I created one for Pivots as well but can't find it at the moment (don't feel like digging). I haven't looked at your code, but you may have wanted a routine to find the nearest pivot. That function is in the example above, you'll have to just replace Murrey Math lines with pivot lines.
I use daily floor pivots with CL in my trading and find them very useful.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The following user says Thank You to Big Mike for this post: