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



Swing Hi/Lo points for indicator values?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one zacharydw00 with 5 posts (1 thanks)
    2. looks_two sam028 with 3 posts (0 thanks)
    3. looks_3 max-td with 2 posts (0 thanks)
    4. looks_4 Trader.Jon with 2 posts (0 thanks)
    1. trending_up 10,558 views
    2. thumb_up 7 thanks given
    3. group 13 followers
    1. forum 18 posts
    2. attach_file 3 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Swing Hi/Lo points for indicator values?

(login for full post details)
  #1 (permalink)
 zacharydw00 
Idaho
 
Experience: Intermediate
Platform: NinjaTrader,ToS
Broker: Amp Futures, ToS
Trading: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 145 since Aug 2009
Thanks: 87 given, 172 received

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.

Started this thread Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(107 thanks from 17 posts)
looks_twoSalao's Journalby Salao
(33 thanks from 8 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(28 thanks from 11 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(14 thanks from 9 posts)
looks_5Maybe a little bit different journalby Malykubo
(9 thanks from 8 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Would You Sell Your System?
73 thanks
The Crude Dude Oil Trading System
44 thanks
Big Mike in Ecuador
42 thanks
The New Micro Contract - MICRO BITCOIN coming May 2021
25 thanks
futures io site changelog and issues/problem reporting
24 thanks
 
(login for full post details)
  #3 (permalink)
 hondo69 
Austin, TX
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Currencies
 
hondo69's Avatar
 
Posts: 165 since Jun 2009
Thanks: 57 given, 245 received


Several times I worked to develop such a code without success. So I dug deeper into the code that creates Swing Hi/Lo points and then compared it to other platforms.

I was quite surprised to find NT calculates these points much differently than TradeStation, for example. Seems to me the key is to rewrite the original NT code such that it calculates pivots in a more simplified fashion. Then use that new code as a basis from which an indicator can be constructed that will "remember" these points for use as output values.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 924 received

hi zach...
it is possible to check Swing Hi/Lo points of indicators say like stochastic, but only with costume coding - not as simple indicator on indicator-function.
maybe we will see this in NT 7 now.

i played with this a while ago ago - dont remember exactly how ....

if i find it i will post an example how i did this / tried this.

max-td
Reply With Quote
 
(login for full post details)
  #5 (permalink)
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 924 received

found it - have a look at this :

 
Code
                            


 double myswinghigh 
=  Swing  (  Stochastics(  714,  4  )  ,  2  )  .SwingHigh 0] ; 
           
 
double myStoch =  Stochastics(  714,  4   )   K  [0] ; 
           

             if  
                (

                
myStoch >   myswinghigh    &&     myswinghigh 50

                

i took stochastics and used it as the input for the NT-Swing-H / L -indicator (.SwingHigh-dataseries here)
of course this is no example for visualisation / plotting now but for a first idea how to use it and for condítionbuilding.

first line calculates the last small Swing-High from stochastic.K
second line = stochastic.K
logic- line : checks if stochastic.K itself breaks its last swing-high AND all is happening above 50 (means in the upper half)

it describes a check for a HigherHigh in stochastic.K so to say.

hope that makes sense.

.

max-td
Reply With Quote
 
(login for full post details)
  #6 (permalink)
 Reggy 
Brooklyn, New York
 
Experience: Intermediate
Platform: Sierra Charts, NinjaTrader, mt4, oanda, some multicharts
Broker: cms forex
Trading: currency futures, forex
 
Reggy's Avatar
 
Posts: 18 since Apr 2010
Thanks: 22 given, 36 received

This might seem clumsy, but it might work. For example, to find the swing high of a 55 period Stochastics:
55sto<55sto.1
55sto.1<55sto.2
55sto.2<55sto.3
55sto.3<55sto.4
55sto.4<55sto.5
55sto.5>55sto.6
55sto.6>55sto.7
55sto.7>55sto.8
55sto.8>55sto.9
55sto.9>55sto.10

Which shows how little I know about this stuff. Just started looking at Ninjatrader a couple of days ago, and trying to learn stuff. Bye the way, I am impressed with Ninjatrader forum support...I posted an intellisense question with the wizard code and got an answer in 5minutes!

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #7 (permalink)
 zacharydw00 
Idaho
 
Experience: Intermediate
Platform: NinjaTrader,ToS
Broker: Amp Futures, ToS
Trading: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 145 since Aug 2009
Thanks: 87 given, 172 received

Thanks for the suggestions guys. I'll check some of your ideas, but first I have to fix a broken irrigation line before the grass dies. I'll post my results as soon as I get back to testing these ideas.
Thanks.

Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
 jcar 
allentown
 
Experience: Advanced
Platform: Ninjatrader, Tradestation
Broker: zen-fire
Trading: 6e,cl
 
jcar's Avatar
 
Posts: 10 since Apr 2010
Thanks: 1 given, 12 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.

Did you ever find away to program the swing high low indicator so that you can implement it in a trading stradegy?

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #9 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,673 since Jun 2009
Thanks: 3,789 given, 4,506 received


jcar View Post
Did you ever find away to program the swing high low indicator so that you can implement it in a trading stradegy?

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, ...


Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
 
(login for full post details)
  #10 (permalink)
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 received


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

Reply With Quote
 
(login for full post details)
  #11 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,673 since Jun 2009
Thanks: 3,789 given, 4,506 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)
Follow me on Twitter Reply With Quote
 
(login for full post details)
  #12 (permalink)
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 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
 
(login for full post details)
  #13 (permalink)
 zacharydw00 
Idaho
 
Experience: Intermediate
Platform: NinjaTrader,ToS
Broker: Amp Futures, ToS
Trading: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 145 since Aug 2009
Thanks: 87 given, 172 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, 129 views)
Started this thread Reply With Quote
The following user says Thank You to zacharydw00 for this post:
 
(login for full post details)
  #14 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,673 since Jun 2009
Thanks: 3,789 given, 4,506 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)
Follow me on Twitter Reply With Quote
 
(login for full post details)
  #15 (permalink)
 zacharydw00 
Idaho
 
Experience: Intermediate
Platform: NinjaTrader,ToS
Broker: Amp Futures, ToS
Trading: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 145 since Aug 2009
Thanks: 87 given, 172 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.

Started this thread Reply With Quote
 
(login for full post details)
  #16 (permalink)
 TimC 
East Coast USA
 
Experience: Intermediate
Platform: NT8
Broker: Amp/CQG
Trading: NQ
 
Posts: 16 since Dec 2009
Thanks: 9 given, 5 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
 
(login for full post details)
  #17 (permalink)
 zacharydw00 
Idaho
 
Experience: Intermediate
Platform: NinjaTrader,ToS
Broker: Amp Futures, ToS
Trading: ES, E7, CL, GC
 
zacharydw00's Avatar
 
Posts: 145 since Aug 2009
Thanks: 87 given, 172 received

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

Started this thread Reply With Quote
 
(login for full post details)
  #18 (permalink)
 spinnybobo 
Crete, IL/USA
 
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
 
spinnybobo's Avatar
 
Posts: 181 since Aug 2009
Thanks: 103 given, 56 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

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #19 (permalink)
 wccktrader 
Singapore
 
Experience: Intermediate
Platform: NinjaTrader, Sierra Charts
Broker: Thinkorswim, IQFeed
Trading: Options of SPY, IWM, QQQ
 
wccktrader's Avatar
 
Posts: 47 since Nov 2010
Thanks: 54 given, 149 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.

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
Click image for larger version

Name:	SwingChartTrend.png
Views:	323
Size:	125.3 KB
ID:	47006  
Attached Files
Register to download File Type: zip SwingChartTrend.zip (5.3 KB, 151 views)
Reply With Quote
The following 6 users say Thank You to wccktrader for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Swing Hi/Lo points for indicator values?


Last Updated on August 20, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

Seven Trading Mistakes Solved With Smart Trading Tools w/Brannigan Barrett

Elite only
     



Copyright © 2021 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