NexusFi: Find Your Edge


Home Menu

 





Coding Multi Time Frame (MTF) Indicators with NinjaTrader


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 180 posts (562 thanks)
    2. looks_two Zondor with 19 posts (29 thanks)
    3. looks_3 madLyfe with 16 posts (10 thanks)
    4. looks_4 BankRobberNT with 14 posts (16 thanks)
      Best Posters
    1. looks_one gomi with 3.7 thanks per post
    2. looks_two Fat Tails with 3.1 thanks per post
    3. looks_3 Zondor with 1.5 thanks per post
    4. looks_4 BankRobberNT with 1.1 thanks per post
    1. trending_up 189,095 views
    2. thumb_up 743 thanks given
    3. group 87 followers
    1. forum 424 posts
    2. attach_file 166 attachments




 
Search this Thread

Coding Multi Time Frame (MTF) Indicators with NinjaTrader

  #161 (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,102


Braulio View Post
Here's how I approached the testing scenario:

1. The first thing I wanted to do was compare the charts I've posted here to see how the historical/real-time data issue was. So I opened a new chart(historical) with the new version of the anaVisualSMA and took a picture right at the same place. The picture is attached and it's called "Testing 05-09-2011". From this first approach I can assume that it still behaves differently on historical and real-time data.

The real-time chart from September 5 was created with the old version of VisualSMA. You now compared the new version on historical data with the old version on real-time data. However, what was changed, is how the new version works on real-time data. So the comparison has no meaning.


Braulio View Post
2. Also wanted to have real-time data on a chart from today and open up a new chart (historical) to compare it with the real-time data of just today. You can see the pictures "Today - Real-time" and "Today - Historical", they do not match.

Are you sure that you uninstalled the old assembly and replaced it with the new one. The real-time behavior of the indicator suggests that it is the old version. Also you have again hidden all the settings, please display them on the chart!


Braulio View Post
3. Now I can't compare the old with the new version as Ninja won't let me have both installed, but to test the improved precision of the VisualSMA's I did just what you did Fat Tails, placed a chart with 2 dataseries in 4Range and 8Range. On top we have the VisualSMA and on the bottom panel the SMA that should be mimicked. I agree that the problem appears to be solved. This is just a first test and I would like to continue and monitor its behavior so that we can get a better confirmation.
B

Here you have confused yourself. The top indicator mimics an SMA(1) on an 8-range chart. But the bottom indicator is a SMA(1) calculated from a 4-range bar series, which you have placed on the false panel. They cannot match! If you set the VisualSMA(1) to 8-range, please compare it to an SMA on a 8-range chart which is calculated from that 8-range chart.

By the way, I appreciate your tests. It is a great help, if somebody else has an in-depth look at the indicators!

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #162 (permalink)
 
Braulio's Avatar
 Braulio 
Portugal
 
Experience: Beginner
Platform: Ninjatrader, Multicharts
Broker: Amp Futures/Zen-Fire
Trading: ES, 6E
Posts: 229 since Aug 2009
Thanks Given: 407
Thanks Received: 217

This wheelchair user test subject made some mistakes. Glad I have an excellent doctor! Now I only need a hot nurse

#1...Yesterday I removed the previous VisualSMA assembly and uploaded the new one into ninja without restarting it...didn't know I should have done that. Think that's what might have caused the charts to look as if nothing had changed.

#2...Ran a new test the same way as the previous one. They now seem to match perfectly. I would really like to understand why that is (if that's not asking for too much).

#3...Yesterday I actually inserted the SMA on the first panel and after realizing that mistake dragged it to the lower one without changing its settings...Nurse!!
But now I went a little bit further. We can see from the picture "Tops + Bottoms" that the VisualSMA matches perfectly with the SMA on the bottom panel and that's a picture taken on the 06-09-2011 where I made a trade. You can see that trade on the "TRADE#9" picture (The 8range VisualSMA is the hot pink dashed line) and compare the new version with the old one. Yes, they do not match at all (I've also attached the template I used for the charts).

Final thoughts : The new version plots completely different from the previous one in real-time, only now it is a perfect match with the corresponding SMA. This means that now we can look back on our charts and backtest for setups/entries, the problem no longer exists.

Thank you Fat Tails.

Attached Thumbnails
Click image for larger version

Name:	Today - Historical.JPG
Views:	205
Size:	97.3 KB
ID:	48756   Click image for larger version

Name:	Today - Real time.JPG
Views:	213
Size:	91.3 KB
ID:	48757   Click image for larger version

Name:	Tops + Bottoms.JPG
Views:	212
Size:	74.5 KB
ID:	48758   Click image for larger version

Name:	TRADE#9.JPG
Views:	198
Size:	99.8 KB
ID:	48759  
Attached Files
Elite Membership required to download: TESTING.xml
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #163 (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,102



Braulio View Post
Final thoughts : The new version plots completely different from the previous one in real-time, only now it is a perfect match with the corresponding SMA. This means that now we can look back on our charts and backtest for setups/entries, the problem no longer exists.

Anyhow, you have discovered a bug and I have removed it. Best of all worlds.

If you want to use the VisualSMA with strategies or for proper backtesting of your P&L, then you need to stick to the StrategyMode.

Started this thread Reply With Quote
Thanked by:
  #164 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

Harry, can you enlighten be regarding post 159? I'm just curious and want to understand.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #165 (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,102


Big Mike View Post
Harry, can you enlighten be regarding post 159? I'm just curious and want to understand.

Mike

Sorry, I had not noticed that post, as there were several posts afterwards.

It is possible to transform the VisualSMA and the VisualEMA into a single indicator. It is also possible to add other moving average types.

However, I did not want to go too fast, because it was an experiment. The latest version of VisualSMA is actually release 8, and it is probably not the last one. The indicator already has over 500 lines of code, which is a lot for an SMA. Hot subjects are differences between historical and real-time data, taking into account session begin and session end, different timestamps on tick-based and minute-based charts, repainting to compensate for lag, different algorithms for interpolation on equidistant and non-equidistant charts, dependence of algorithms on underlying bar types for price projections.

Once the VisualSMA is fine, I will proceed to the next step. But as you notice, I have just removed a bug yesterday. So let us first see, whether there is more feedback.

In the end, the concept can be applied to any indicator.

Started this thread Reply With Quote
Thanked by:
  #166 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

Thanks, that is also why I was confused that you are maintaining two separate code bases instead of merging into one, seems easier that way

Good job as always.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #167 (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,102


Big Mike View Post
Thanks, that is also why I was confused that you are maintaining two separate code bases instead of merging into one, seems easier that way

Good job as always.

Mike

Was easier to create two indicators. Took the VisualSMA and substituted "SMA" for "EMA". This was ways faster than to add an enum, 30 lines of code and a property. I am sometimes lazy.

Started this thread Reply With Quote
Thanked by:
  #168 (permalink)
 
bluemele's Avatar
 bluemele 
Honolulu, Hawaii
 
Experience: Intermediate
Platform: NinjaTrader
Broker: ATC/TT, AMP/Zen-Fire, AMP/CQG
Trading: TF
Posts: 2,543 since Jun 2010
Thanks Given: 3,803
Thanks Received: 2,842


Fat Tails View Post
Was easier to create two indicators. Took the VisualSMA and substituted "SMA" for "EMA". This was ways faster than to add an enum, 30 lines of code and a property. I am sometimes lazy.

Dude, you are about the unlaziest person I have met through the internet.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #169 (permalink)
 
madLyfe's Avatar
 madLyfe 
Des Moines, Iowa
 
Experience: None
Platform: Ninja, TOS
Broker: AMP/CQG, TOS
Trading: CL, TF, GC
Posts: 1,641 since Feb 2011
Thanks Given: 9,220
Thanks Received: 1,020


bluemele View Post
Dude, you are about the unlaziest person I have met through the internet.

i have to tatally agree w u! thanks to ya fatty!

dont believe anything you hear and only half of what you see

¯\_(ツ)_/¯

(╯°□°)╯︵ ┻━┻
Visit my NexusFi Trade Journal Reply With Quote
  #170 (permalink)
 
Braulio's Avatar
 Braulio 
Portugal
 
Experience: Beginner
Platform: Ninjatrader, Multicharts
Broker: Amp Futures/Zen-Fire
Trading: ES, 6E
Posts: 229 since Aug 2009
Thanks Given: 407
Thanks Received: 217


I think I may have found something else...

This morning Ninja kept giving me the following error message :

09-09-2011 07:29:34 Default Connection to NinjaTrader historical market data server lost: The process cannot access the file 'C:\Users\BP\Documents\NinjaTrader 7\db\tick\6E 09-11\201109090800.Last.ntd' because it is being used by another process.

I logged on and off, restarted Ninja and it the error message kept popping up everytime I tried to connect but then I noticed something : all the windows (I have 13 chart windows open) were being updated with data (I can see the candles and all the indicators, etc) EXCEPT the charts that have VisualSMA's...they were blank. Because that got me a little suspicious, I decided to close all the charts that have VisualSMA's and restart Ninja. Now the error message is gone.
After a successful connection, I re-opened my charts with VisualSMA's and everything seems fine.

Might there be an issue with the VisualSMA's accessing tick data on these files?

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on April 19, 2022


© 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