Swing Hi/Lo points for indicator values? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Swing Hi/Lo points for indicator values?
Updated: Views / Replies:7,824 / 18
Created: by zacharydw00 Attachments:3

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 3  
 
Thread Tools Search this Thread
 

Swing Hi/Lo points for indicator values?

  #11 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received


Trader.Jon View Post
Sam,

Any thoughts on how to use (code) previous swing levels as profit targets ? I am thinking on as momentum stays above a certain level, then the profit target keeps moving from previous swing level to the next profitable swing level, and then as ROC falls the profit target drops to the price as market order.

Jon

Their are many ways to do this, but the easier is maybe to use a multidimensional array, to store the previous swing levels.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #12 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received


sam028 View Post
Their are many ways to do this, but the easier is maybe to use a multidimensional array, to store the previous swing levels.


Do you know a strategy or indicator that would use that type of array so I can have a look at the code?

Reply With Quote
 
  #13 (permalink)
Elite Member
Idaho
 
Futures Experience: Intermediate
Platform: NinjaTrader,ToS
Broker/Data: Amp Futures, ToS
Favorite Futures: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 139 since Aug 2009
Thanks: 81 given, 164 received


Jon here's a simple (NT 6.5) strategy I was testing on the ES a few months back that uses swing Hi/Lo point patterns to enter trades. If you can improve the entry signals that would be great. At least, hopefully the Hi/Lo code will help you out.

Attached Files
Register to download File Type: zip GRTswingHiLoV1d20100128.zip (11.0 KB, 124 views)
Reply With Quote
The following user says Thank You to zacharydw00 for this post:
 
  #14 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received


Trader.Jon View Post
Do you know a strategy or indicator that would use that type of array so I can have a look at the code?

Sorry, I didn't found any piece of NT code using multi dimensional arrays, but if you just need to store the previous swing high/swing low, using two simple variables is enough, something like (pseudo-code not tested):
 
Code
                            
init() {

  
_previous_high=Swing(5).SwingHigh[0];
  
_previous_low=Swing(5).SwingLow[0];
}
protected 
override void OnBarUpdate() {
if (
_previous_high != Swing(5).SwingHigh[0] )
  
_previous_high=Swing(5).SwingHigh[0];
if (
_previous_low != Swing(5).SwingLow[0] )
  
_previous_low=Swing(5).SwingLow[0];
_stop_Long=_previous_low;
_stop_Short=_previous_high;...} 

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #15 (permalink)
Elite Member
Idaho
 
Futures Experience: Intermediate
Platform: NinjaTrader,ToS
Broker/Data: Amp Futures, ToS
Favorite Futures: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 139 since Aug 2009
Thanks: 81 given, 164 received


zacharydw00 View Post
Any one know of an indicator or code that will identify the Swing Hi/Lo points of an indicator's output value? NT's Swing indicator uses the High & Low functions, which can't be applied to an ind. value. Thanks.

I was wrong about the Swing ind. To update anyone who's following this post, I am making good progress on my divergence ind. I'm working on the the more complex part first... getting it to work with the MACD Histogram.

FYI- Europe is sinking. Short the E7.

Reply With Quote
 
  #16 (permalink)
Elite Member
East Coast USA
 
Futures Experience: Intermediate
Platform: NT7
Broker/Data: Amp/CQG
Favorite Futures: NQ
 
Posts: 15 since Dec 2009
Thanks: 9 given, 3 received

Does anyone know if the "mean" of the swing h/l indicator can be plotted? Similar to the Donchian channel mean.

Reply With Quote
 
  #17 (permalink)
Elite Member
Idaho
 
Futures Experience: Intermediate
Platform: NinjaTrader,ToS
Broker/Data: Amp Futures, ToS
Favorite Futures: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 139 since Aug 2009
Thanks: 81 given, 164 received

Simple answer... Yes. It probably would be fairly easy to modify NT's Swing ind to calc and plot the mean.

Reply With Quote
 
  #18 (permalink)
Elite Member
Crete, IL/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker/Data: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Favorite Futures: ES, CL, EUR/USD, TF
 
spinnybobo's Avatar
 
Posts: 171 since Aug 2009
Thanks: 99 given, 48 received


sam028 View Post
If you mean a strategy using the Swing built-in indicator, it's easy, something like:
 
Code
                            
if (Close[0] > Swing(5).SwingHigh[0]) {
  
Golong();
  
etcetc, ...
}
if (
Close[0] < Swing(5).SwingLow[0]) {
  
GoShort();
  
etcetc, ...


Hi Sam
this simple code worked well for me, but I noticed once the next bar would be > the swing high, it would still go long and opposite for short. so, I think

 
Code
if(High[0] > Swing(5).SwingHigh[0] && High[1] < Swing(5).SwingHigh[0])
   GoLong();
if(Low[0] < Swing(5).SwingLow[0] && Low[1] > Swing(5).SwingLow[0])
  GoShort();
this is assuming you only want to go long the 1st time it breaks out or breaks down, rather than going long and short over and over just because it is above or below the swing level

thanks and love your webinar
Spencer

Reply With Quote
 
  #19 (permalink)
Elite Member
Singapore
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Charts
Broker/Data: Thinkorswim, IQFeed
Favorite Futures: Options of SPY, IWM, QQQ
 
wccktrader's Avatar
 
Posts: 47 since Nov 2010
Thanks: 54 given, 141 received

SwingChartTrend Indicator


zacharydw00 View Post
Any one know of an indicator or code that will identify the Swing Hi/Lo points of an indicator's output value? NT's Swing indicator uses the High & Low functions, which can't be applied to an ind. value. Thanks.

Attached is an indicator that I have coded based on NT's Swing indicator. It shows the trend based on a specified swing strength/period. The indicator can be referenced from a strategy. The code for a simple crossover strategy could be as follows:


if
(Close[0] < SwingChartTrend(SwingPeriod).SupplyLine[0]
&& Close[
1] > SwingChartTrend(SwingPeriod).DemandLine[1])



{

DrawArrowDown(
"My down arrow" + CurrentBar, false, 0, High[0]+(8*TickSize), Color.Red);

}

if (Close[0] > SwingChartTrend(SwingPeriod).DemandLine[0]
&& Close[
1] < SwingChartTrend(SwingPeriod).SupplyLine[1])



{

DrawArrowUp(
"My up arrow" + CurrentBar, false, 0, Low[0]+(-8*TickSize), Color.Green);

}



Attached Thumbnails
Swing Hi/Lo points for indicator values?-swingcharttrend.png  
Attached Files
Register to download File Type: zip SwingChartTrend.zip (5.3 KB, 141 views)
Reply With Quote
The following 5 users say Thank You to wccktrader for this post:

Reply



futures io > > > > > Swing Hi/Lo points for indicator values?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing/Pivot Points trs3042 Traders Hideout 3 November 28th, 2010 10:58 PM
ZigZag indicator but with tick difference shown at the pivot points wuolong NinjaTrader 3 April 6th, 2010 09:59 AM
Printing values from Fractal Indicator eurostoxx NinjaTrader Programming 1 December 14th, 2009 08:22 AM
Referencing values in another indicator or Saroj NinjaTrader Programming 0 September 5th, 2009 12:02 AM
Translating EMA-values to ZN-values or visaversa max-td NinjaTrader Programming 17 June 22nd, 2009 04:42 PM


All times are GMT -4. The time now is 01:54 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-13 in 0.15 seconds with 38 queries on phoenix via your IP 54.92.201.232