Highest or lowest swings - NinjaTrader Programming | futures io social day trading
futures io futures trading


Highest or lowest swings
Updated: Views / Replies:1,770 / 4
Created: by luitom Attachments:0

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
 
Thread Tools Search this Thread
 

Highest or lowest swings

  #1 (permalink)
Elite Member
Firenze, Italy
 
Futures Experience: Advanced
Platform: ninja
Favorite Futures: currency futures
 
Posts: 4 since Mar 2011
Thanks: 0 given, 0 received

Highest or lowest swings

I am trying to write a code that will able to find the lowest of the last X swing lows and the highest of the X swing lows by using the Swing indicator in Ninjatrader.

This is how I did it

MIN(Swing(BarsArray[1], 1).SwingLow, X)[0];

MAX(Swing(BarsArray[1], 1).SwingHigh, X)[0];

For some reason it does seem to be working. My impression is these functions find the highest swing high of the the last X days and not the highest of the last X swing highs (which may be useful too but it is not what I am looking for).

I have been told that I need to use ArrayLists but I have not idea how to go about it; it goes beyond my programming skills and I found nothing on Ninjascript. Can anybody help please?

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received



luitom View Post
I am trying to write a code that will able to find the lowest of the last X swing lows and the highest of the X swing lows by using the Swing indicator in Ninjatrader.

This is how I did it

MIN(Swing(BarsArray[1], 1).SwingLow, X)[0];

MAX(Swing(BarsArray[1], 1).SwingHigh, X)[0];

For some reason it does seem to be working. My impression is these functions find the highest swing high of the the last X days and not the highest of the last X swing highs (which may be useful too but it is not what I am looking for).

I have been told that I need to use ArrayLists but I have not idea how to go about it; it goes beyond my programming skills and I found nothing on Ninjascript. Can anybody help please?

Hi,

My quick impression, if the approach is valid (didn't spend the time), is the problem might be the BarsArray[1]. Try BarsArray[0] here to see if it does what you expect. I think you need to have a multi-series strategy/indicator to us [1].

Hope that helps.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote
 
  #4 (permalink)
Elite Member
Firenze, Italy
 
Futures Experience: Advanced
Platform: ninja
Favorite Futures: currency futures
 
Posts: 4 since Mar 2011
Thanks: 0 given, 0 received

Sorry I did not explain why I have BarsArray[1] in the indicator. The reason is just that I am working on multi time frame and I created a BarsArray of daily bars in Initialize section

Add(PeriodType.Day,1);

That has nothing to do with what I am looking for; the code could easily be

MIN(Swing(1).SwingLow, X)[0];

MAX(Swing(1).SwingHigh, X)[0];


Sorry about the confusion




Reply With Quote
 
  #5 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received

Okay,

I think Swing might have "missing values". I don't know if MIN/MAX ignore these values. YOu might need to scan the array yourself with a for/next loop and ignore missing values.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote

Reply



futures io > > > > > Highest or lowest swings

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Efficient Code for finding highest high and lowest lows of a range of bars. xigreek NinjaTrader Programming 18 July 31st, 2015 03:54 PM
rassi swings the bat rassi Elite Trading Journals 72 August 23rd, 2011 03:53 AM
Chart-based trading behind big market swings kbit News and Current Events 1 August 10th, 2011 10:03 PM
Are Exchange Traded Funds Causing Wild Market Swings? Quick Summary News and Current Events 0 September 15th, 2010 09:00 PM
Morgan Stanley Swings to Profit, Smashes Estimates Quick Summary News and Current Events 0 July 21st, 2010 09:30 AM


All times are GMT -4. The time now is 02:40 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-14 in 0.09 seconds with 19 queries on phoenix via your IP 54.221.76.68