NexusFi: Find Your Edge


Home Menu

 





Help using ZigZagUTCSwing in strategy


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 Pepperdog 
USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: NQ
Posts: 32 since Aug 2009
Thanks Given: 12
Thanks Received: 58

Hey guys, I think this should be an easy one, I hope, but I am somewhat of a hack with C# so I am having a bit of trouble.

I want to use a swing indicator (ZigZagUTCSwing at the moment, but open to suggestions if there is anything "better") to tell if the last swing high/low was higher or lower than the previous swing high/low. In the ZigZagUTCSwing indicator I see two DataSeries of hi and lo, presumably these are the swing high and low price values that are used by the indicator to determine how/what to plot? There is also a public int variable of direction, either 1 or -1, for the direction of the current zigzag trend. I have not reviewed the code in great detail, but this is how I currently understand it.

If I try to call the hi or lo DataSeries to compare the values in the strategy, I get an error "inaccessible due to its protection level". What does this error mean? So next I try to use the direction variable to determine the swing trend direction, but it appears to me that this variable is *always* 0. This doesn't make any sense, because the direction variable has to change 1/-1 in the ZigZagUTCSwing indicator for it to work!?

Maybe I am just going about this all wrong. All I want my strategy to do is only go long if both the last swing high and low were higher than the previous swing high and low, or go short if both the last swing high and low were lower than the previous swing high and low, excluding double bottoms and double tops (other entry criteria will also apply). Any ideas how I might approach this with ZigZagUTCSwing or some other similar indicator?

I've attached a quick example of what I mean, hopefully it makes sense. (The dots fire when my other entry criteria is met)

Thanks!


Attached Thumbnails
Click image for larger version

Name:	6B 12-09  11_12_2009 (SbSRenko 4 Ticks).png
Views:	481
Size:	87.0 KB
ID:	4459  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Kharg Island at 6%, Regime Fall at 1.5% -- The Black Swa …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
SEC Chairman Calls for New Golden Age of SEC-CFTC Regula …
Traders Hideout
Asia Equities Crash Overnight -- Nikkei -5.2%, KOSPI -6. …
Traders Hideout
NinjaTrader Connect Launches -- Krakens $1.5B Acquisitio …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #2 (permalink)
 
wh's Avatar
 wh 
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
Posts: 538 since Jun 2009
Thanks Given: 298
Thanks Received: 512


Quoting 
If I try to call the hi or lo DataSeries to compare the values in the strategy, I get an error "inaccessible due to its protection level". What does this error mean? So next I try to use the direction variable to determine the swing trend direction, but it appears to me that this variable is *always* 0. This doesn't make any sense, because the direction variable has to change 1/-1 in the ZigZagUTCSwing indicator for it to work!?

your problem is "private method". there are serval approach to get data. do you know the concept of oo-programming. look for public, protected, private and look also in the ninja-api.


Reply With Quote




Last Updated on November 14, 2009


© 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