Go Back   NinjaTrader Support Forum > NinjaTrader 7 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 09-20-2009, 07:40 PM   #1
billm
Member
 
Join Date: Aug 2008
Posts: 40
Thanks: 0
Thanked 0 times in 0 posts
Default Demand Index

Has anyone coded the Demand Index designed by James Sibbet?
billm is offline  
Reply With Quote
Old 09-21-2009, 03:38 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 26,242
Thanks: 495
Thanked 1,866 times in 1,796 posts
Default

billm, unfortunately I'm not aware of one already posted, have you checked into the sharing section already?

http://www.ninjatrader-support2.com/...splay.php?f=37
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 09-21-2009, 06:37 AM   #3
billm
Member
 
Join Date: Aug 2008
Posts: 40
Thanks: 0
Thanked 0 times in 0 posts
Default

Hello Bertrand, yes, I searched and found nothing posted. As it is a less popularized calculation from the days of computrac maybe its value has been overlooked?
billm is offline  
Reply With Quote
Old 09-21-2009, 06:44 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 26,242
Thanks: 495
Thanked 1,866 times in 1,796 posts
Default

Might be, I don't think it's that popular - if you have the formula and want to give it a shot, here are the indicator coding tutorials - http://www.ninjatrader-support.com/H...verview18.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-11-2010, 06:19 PM   #5
ADX Trader
Junior Member
 
Join Date: Jul 2010
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
Default

I have used the Demand Index for years and find it helpful at divergent bottoms (i.e. BA on 06/07/2010). I am converting from TradeStation, have the TS2ki code and would be thankful if someone can code it in NT
ADX Trader is offline  
Reply With Quote
Old 04-26-2018, 10:22 AM   #6
rolom@hotmail.com
Junior Member
 
Join Date: Oct 2016
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Coded Demand index for NT 7.0

Quote:
Originally Posted by billm View Post
Has anyone coded the Demand Index designed by James Sibbet?

This is the Coded from another platform, can some one coded it for NT7.0

#

declare lower;

input length = 5;

def wClose = (high + low + 2 * close) * 0.25;
def wCRatio = (wClose - wClose[1]) / Min(wClose, wClose[1]);
def closeRatio = 3 * wClose / Average(Highest(High, 2) - Lowest(Low, 2), length) * AbsValue(wCRatio);
def volumeRatio = Volume / Average(Volume, length);
def volumePerClose = volumeRatio / exp(Min(88, closeRatio));
def buyP;
def sellP;
if (wCRatio > 0) {
buyP = volumeRatio;
sellP = volumePerClose;
} else {
buyP = volumePerClose;
sellP = volumeRatio;
}
def buyPres = if IsNaN(buyPres[1]) then 0 else ((buyPres[1] * (length - 1)) + buyP) / length;
def sellPres = if IsNaN(sellPres[1]) then 0 else ((sellPres[1] * (length - 1)) + sellP) / length;
def tempDI;
if ((((sellPres[1] * (length - 1)) + sellP) / length - ((buyPres[1] * (length - 1)) + buyP) / length) > 0) {
tempDI = - if (sellPres != 0) then buyPres / sellPres else 1;
} else {
tempDI = if (buyPres != 0) then sellPres / buyPres else 1;
}
plot DMIndx = if IsNaN(close) then Double.NaN else if tempDI < 0 then -1 - tempDI else 1 - tempDI;
plot ZeroLine = 0;

DMIndx.setDefaultColor(GetColor(1));
ZeroLine.SetDefaultColor(GetColor(5));
rolom@hotmail.com is offline  
Reply With Quote
Old 04-28-2018, 12:21 AM   #7
nkhoi
Senior Member
 
Join Date: Nov 2004
Location: , ,
Posts: 165
Thanks: 10
Thanked 30 times in 19 posts
Default

Quote:
Originally Posted by rolom@hotmail.com View Post
This is the Coded from another platform, can some one coded it for NT7.0

#

declare lower;

input length = 5;

def wClose = (high + low + 2 * close) * 0.25;
def wCRatio = (wClose - wClose[1]) / Min(wClose, wClose[1]);
def closeRatio = 3 * wClose / Average(Highest(High, 2) - Lowest(Low, 2), length) * AbsValue(wCRatio);
def volumeRatio = Volume / Average(Volume, length);
def volumePerClose = volumeRatio / exp(Min(88, closeRatio));
def buyP;
def sellP;
if (wCRatio > 0) {
buyP = volumeRatio;
sellP = volumePerClose;
} else {
buyP = volumePerClose;
sellP = volumeRatio;
}
def buyPres = if IsNaN(buyPres[1]) then 0 else ((buyPres[1] * (length - 1)) + buyP) / length;
def sellPres = if IsNaN(sellPres[1]) then 0 else ((sellPres[1] * (length - 1)) + sellP) / length;
def tempDI;
if ((((sellPres[1] * (length - 1)) + sellP) / length - ((buyPres[1] * (length - 1)) + buyP) / length) > 0) {
tempDI = - if (sellPres != 0) then buyPres / sellPres else 1;
} else {
tempDI = if (buyPres != 0) then sellPres / buyPres else 1;
}
plot DMIndx = if IsNaN(close) then Double.NaN else if tempDI < 0 then -1 - tempDI else 1 - tempDI;
plot ZeroLine = 0;

DMIndx.setDefaultColor(GetColor(1));
ZeroLine.SetDefaultColor(GetColor(5));
I always look out for interesting volume indicator, try this.
Edit: just realize this is almost 10 year old thread.
Attached Files
File Type: cs DemandIndex.cs (8.1 KB, 8 views)
Last edited by nkhoi; 04-28-2018 at 12:23 AM.
nkhoi is offline  
Reply With Quote
The following user says thank you to nkhoi for this post:
Old 05-03-2018, 08:14 AM   #8
NinjaTrader_JoshG
NinjaTrader Customer Service
 
NinjaTrader_JoshG's Avatar
 
Join Date: Jun 2017
Location: Denver, CO
Posts: 477
Thanks: 13
Thanked 104 times in 100 posts
Default

This indicator has been converted to NT8 and can be found at the following link:
https://ninjatrader.com/support/foru...=7&linkid=1091
NinjaTrader_JoshG is offline  
Reply With Quote
The following user says thank you to NinjaTrader_JoshG for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does eSignal "On Demand" even work with NT?!? ninja.man Platform Technical Support 2 03-09-2009 12:03 PM
Ninja Trader and ESignal on Demand Robwynge Platform Technical Support 3 01-22-2009 02:29 PM
some help with an index miketpcc2 General Development 1 07-18-2008 11:24 AM
Training Seminars on demand devonkyle Suggestions And Feedback 2 04-14-2008 05:26 PM
Symbol Mapping - stock index to futures index contract tmd Platform Technical Support 9 12-07-2006 10:53 AM


All times are GMT -6. The time now is 07:08 AM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.