NexusFi: Find Your Edge


Home Menu

 





Building a Simple NT8 Indicator


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
bld5
Istanbul/Turkey
 
Posts: 6 since May 2013
Thanks Given: 2
Thanks Received: 0

Hello,

I need to create a simple NT8 indicator but I have no familiarity with NT8 coding.

Here is what I want the indicator to show:(last x periods' highest value - last x periods' lowest value) / 2

It would be great if someone can send me the code or maybe assist me on how I can edit an existing indicator.

Thanks.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Bitcoin’s 2022 low, 2025 high and 2026 low so far arou …
Cryptocurrency
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
What we know about Binances $6.3bn hack - BBC News
Cryptocurrency
[WTS] ATAS Lifetime ULTRA license – EU buyers only – …
Platforms and Indicators
AI for Traders — Agents, Memory, Tools & Real-Worl …
Elite Quantitative GenAI/LLM
 
  #2 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


bld5 View Post
Hello,

I need to create a simple NT8 indicator but I have no familiarity with NT8 coding.

Here is what I want the indicator to show:(last x periods' highest value - last x periods' lowest value) / 2

It would be great if someone can send me the code or maybe assist me on how I can edit an existing indicator.

Thanks.

this code should compile OK


Attached Files
Elite Membership required to download: MyCustomIndicator.cs
Reply With Quote
Thanked by:
  #3 (permalink)
bld5
Istanbul/Turkey
 
Posts: 6 since May 2013
Thanks Given: 2
Thanks Received: 0


Cory thanks for your quick reply.

I renamed an existing indicator, deleted all content and pasted your code but after hitting compile it gave several error messages. I am not sure if I did something wrong. Could you please post it in zip format so that I can directly import it?


Reply With Quote
  #4 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


bld5 View Post
Cory thanks for your quick reply.

I renamed an existing indicator, deleted all content and pasted your code but after hitting compile it gave several error messages. I am not sure if I did something wrong. Could you please post it in zip format so that I can directly import it?

1) copy .cs file to \Documents\NinjaTrader 8\bin\Custom
2) open any indicator and compile it (this will re-compile all indicators )
3) look for mycustomindictor on your list, it's ready to use. If you want to rename it, open it and right click and give it a name you want then save and compile the new indicator.


Reply With Quote
  #5 (permalink)
bld5
Istanbul/Turkey
 
Posts: 6 since May 2013
Thanks Given: 2
Thanks Received: 0

Cory I followed the steps, mycustomindicator showed up on the list, I added to a chart but there was no visible line. Any ideas?


Reply With Quote
  #6 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


bld5 View Post
Cory I followed the steps, mycustomindicator showed up on the list, I added to a chart but there was no visible line. Any ideas?

It doesn’t show line it shows value of h - l / 2 looks at bottom of the last 10 bars the message shows there


Reply With Quote
  #7 (permalink)
bld5
Istanbul/Turkey
 
Posts: 6 since May 2013
Thanks Given: 2
Thanks Received: 0

I was told that what I look for is the midline of Donchian Channel, so problem solved.

Thanks.


Reply With Quote




Last Updated on December 13, 2017


© 2026 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 - Downloads - Top
no new posts