NexusFi: Find Your Edge


Home Menu

 





SupDemZones Indicator Help


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Rovo27 with 5 posts (3 thanks)
    2. looks_two trendisyourfriend with 2 posts (1 thanks)
    3. looks_3 GeeBee with 1 posts (0 thanks)
    4. looks_4 Ssjaznguy with 1 posts (0 thanks)
      Best Posters
    1. looks_one heyyo1432 with 2 thanks per post
    2. looks_two Goldenarm with 1 thanks per post
    3. looks_3 Rovo27 with 0.6 thanks per post
    4. looks_4 trendisyourfriend with 0.5 thanks per post
    1. trending_up 4,840 views
    2. thumb_up 7 thanks given
    3. group 11 followers
    1. forum 12 posts
    2. attach_file 2 attachments




 
Search this Thread

SupDemZones Indicator Help

  #1 (permalink)
 heyyo1432 
miami, FL
 
Experience: Beginner
Platform: Ninja Trader 8
Broker: amp future + CQG
Trading: CL, ES, ZB, ZN, GC, TF, YM
Posts: 2 since Jun 2017
Thanks Given: 1
Thanks Received: 3

Hi mk77ch,

**I was going to place this as private message, but this may help others in the forum, so I am posting this in a public thread.**

My name is Jake, I am brand new to future.io and brand new to programming/ninja script.
I have pretty much zero experience with ninja script or coding in general. I found out about programming ninja script maybe a few weeks ago and I am very excited to learn.

First off - Thank you for uploading your indicator I am sure it will help a lot of us here in the forums reach new heights in our trading!

I'm hoping you [or another expert] can help me or point me in the right direction:

I have NT 8 and I recently downloaded your indicator SupDemZones. I gotta say that is some impressive coding skills. It's a great indicator, and it's exactly what I needed for a strategy I want to build.

The problem: I don't know how to call it in the strategy. for example, I am attempting to add it onto my screen:

else if (State == State.DataLoaded)
{ //begin state.dataloaded
//here is where you can add indicators and visuals to charts
AddChartIndicator(SupDemZones(Input, useMTF, barType, barPeriod, demandColor, supplyColor, activeLineOpacity, activeAreaOpacity, brokenLineOpacity, brokenAreaOpacity, lineWidth, extendZones, hideActiveZones, hideBrokenZones, indicatorVersion));

and I get a compile error: Indicator 'SupDemZones': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.

not sure what that means. Any ideas?

Also - If I want to get values of the demand zone that just appeared: ie - demandzone[0] and get the high and low values of it, how would I do that?

i.e. - i.e. - Variable1 = demandzone[0].high, variable2 = demandzone[0].Low

I am not sure of the syntax here for this indicator.

Also - Would it be possible for you to help me out by sending me the syntax or a reference/location/website where i can find out if the zones have been tested already or not for this particular indicator?

i.e.- bool ZoneTested (set to false if no retests, set true if retested already).

Again, not sure of the syntax here.

For my strategy, I only want to set an entry in a zone that is going with the direction, preferrably EARLY in the direction, and zone is UNTESTED.

Thank you so much for your help!

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
45 thanks
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #3 (permalink)
 GeeBee 
Totonto,Ontario, Canada
 
Experience: Beginner
Platform: Ninja Trader, Meta Trader
Trading: Crude Oil, Forex
Frequency: Daily
Duration: Minutes
Posts: 31 since Nov 2011
Thanks Given: 5
Thanks Received: 9



heyyo1432 View Post
Hi mk77ch,

**I was going to place this as private message, but this may help others in the forum, so I am posting this in a public thread.**

My name is Jake, I am brand new to future.io and brand new to programming/ninja script.
I have pretty much zero experience with ninja script or coding in general. I found out about programming ninja script maybe a few weeks ago and I am very excited to learn.

First off - Thank you for uploading your indicator I am sure it will help a lot of us here in the forums reach new heights in our trading!

I'm hoping you [or another expert] can help me or point me in the right direction:

I have NT 8 and I recently downloaded your indicator SupDemZones. I gotta say that is some impressive coding skills. It's a great indicator, and it's exactly what I needed for a strategy I want to build.

The problem: I don't know how to call it in the strategy. for example, I am attempting to add it onto my screen:

else if (State == State.DataLoaded)
{ //begin state.dataloaded
//here is where you can add indicators and visuals to charts
AddChartIndicator(SupDemZones(Input, useMTF, barType, barPeriod, demandColor, supplyColor, activeLineOpacity, activeAreaOpacity, brokenLineOpacity, brokenAreaOpacity, lineWidth, extendZones, hideActiveZones, hideBrokenZones, indicatorVersion));

and I get a compile error: Indicator 'SupDemZones': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.

not sure what that means. Any ideas?

Also - If I want to get values of the demand zone that just appeared: ie - demandzone[0] and get the high and low values of it, how would I do that?

i.e. - i.e. - Variable1 = demandzone[0].high, variable2 = demandzone[0].Low

I am not sure of the syntax here for this indicator.

Also - Would it be possible for you to help me out by sending me the syntax or a reference/location/website where i can find out if the zones have been tested already or not for this particular indicator?

i.e.- bool ZoneTested (set to false if no retests, set true if retested already).

Again, not sure of the syntax here.

For my strategy, I only want to set an entry in a zone that is going with the direction, preferrably EARLY in the direction, and zone is UNTESTED.

Thank you so much for your help!




Hi heyyo1432

I have updated NT7 to NT8 and was looking mkSupDemZones for NT8. As you have mentioned that you have downloaded for NT8.
Could you please forward the link where to find the mkSupDemZones for NT8 or attach the indicator file.

Thank you in advance.

Reply With Quote
  #4 (permalink)
 eliasshokry 
Atlanta, Georgia
 
Experience: Intermediate
Platform: Ninja Trader
Trading: futures
Posts: 10 since Feb 2023
Thanks Given: 5
Thanks Received: 1

Is it possible to post this strategy?

Reply With Quote
  #5 (permalink)
 
Rovo27's Avatar
 Rovo27 
Austin + TX/United States
 
Experience: Advanced
Platform: Ninjatrader 8
Broker: Rithmic
Trading: NQ
Posts: 78 since Aug 2020
Thanks Given: 23
Thanks Received: 122

I know how to make a strategy based on this indicator and have made a few in the past. Lmk what kind of strategy you want me to post and I'll do so.

Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Rovo27's Avatar
 Rovo27 
Austin + TX/United States
 
Experience: Advanced
Platform: Ninjatrader 8
Broker: Rithmic
Trading: NQ
Posts: 78 since Aug 2020
Thanks Given: 23
Thanks Received: 122

Here's a basic strategy I have created for it.

Rules:

1. If the high of a active supply zone is below EMA enter short with a limit order at the low of the supply zone.
2. If the low of a active demand zone is above EMA enter long with a limit order at the high of the demand zone.
3. If long, stop loss is 1 tick below the demand zone.
4. If short, stop loss is 1 tick above the supply zone zone.
5. Profit target is twice the risk.

The EMA filter for longs or shorts is optional to enable or disable. Enjoy and lmk if you want me to make different rules for it.

***To run the strategy, you may have to remove the original SupDemZones indicator from NT8 as the strategy includes the indicator within it and some identical methods conflict. If there's enough interest I may try to fix the issue.

Attached Thumbnails
Click image for larger version

Name:	image_893.png
Views:	190
Size:	38.8 KB
ID:	329716  
Attached Files
Elite Membership required to download: SupDemZonesStrategyV1.zip
Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 Ssjaznguy 
la puente, California
 
Experience: None
Platform: NinjaTrader
Trading: Es
Posts: 30 since Oct 2018
Thanks Given: 7
Thanks Received: 1

was gonna try to use your code for inspiration on my current strategy. dont know where to start, but thank you for sharing!

Reply With Quote
  #8 (permalink)
 
Rovo27's Avatar
 Rovo27 
Austin + TX/United States
 
Experience: Advanced
Platform: Ninjatrader 8
Broker: Rithmic
Trading: NQ
Posts: 78 since Aug 2020
Thanks Given: 23
Thanks Received: 122

You're welcome. I haven't found a way to make the strategy I posted consistently profitable so keep that in mind.

Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,175
Thanks Received: 6,020


Rovo27 View Post

***To run the strategy, you may have to remove the original SupDemZones indicator from NT8 as the strategy includes the indicator within it and some identical methods conflict. If there's enough interest I may try to fix the issue.

Could you not modify the original indicator (SupDemZones) in order to expose the most recent zone above price or below price to make your strategy less complicated and easier to read?

 
Code
Exposed lists in the original indicator
---
List<double> supplyTop = new List<int>() { 1000, 1050, 1100, 1150, 1200 };
List<double> supplyBottom = new List<int>() { 975, 1025, 1075, 1125, 1175 };
List<double> demandTop = new List<int>() { ... };
List<double> demandBottom = new List<int>() { ... };

if (supplyTop.Count > 0) {
   double lastItemSupplyTop = supplyTop[supplyTop.Count - 1]; // 1200
   double lastItemSupplyBottom = supplyBottom[supplyBottom.Count - 1]; // 1175
}

Reply With Quote
Thanked by:
  #10 (permalink)
 
Rovo27's Avatar
 Rovo27 
Austin + TX/United States
 
Experience: Advanced
Platform: Ninjatrader 8
Broker: Rithmic
Trading: NQ
Posts: 78 since Aug 2020
Thanks Given: 23
Thanks Received: 122


Can you clarify further what you mean by expose? In the original indicator the active zones are more saturated and less translucent than the broken zones. The nearest active zones are the zones the next trade will use as a entry and exit calculations in the basic strategy I provided.

Honestly the only reason you may have to remove the original indicator file if you already have it is because the only reasonable way I found to create a strategy from it was from embedding the strategy within the indicator itself. I’m sure a better coder would know how to do it more efficiently.

If you just want to know where I added the strategy logic let me know and I can give you the line numbers.


Sent using the NexusFi mobile app

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on February 3, 2024


© 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