Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am looking at the the code to access the values of the swings so that if Close[1] > SwingRayHiValue[1] == try to go long etc. Nothing is displayed in the DataBox: can someone please take a look at the code to see what can be exposed for that strategy input? There are already DataSeries that are 'public' but they dont show in the DataBox.
I tried moving the arraycode from the Initialize to the OnBarUpdate but that didnt help.
Assist is very apprecaited,
Jon
Can you help answer these questions from other members on NexusFi?
Not yet ... but I will ... but I am guessing that it will only expose the very last hi and lo in the array, not all the values being drawn on the chart?! hhhmmmm ... guess that means I will have to try MRO(whatever I need to do here)etc; .. this will be interesting!
I just downloaded and installed the indicator you referenced.
There are no DataSeries definitions in the indicator. Thus none can display in the DataBox.
And the only places in the SwingRay2 indicator where it says "DataSeries" are not definitions of a DataSeries, they are properties that referencesthe Values array of DataSeries that NinjaTrader provides. The indicator also has no code to set values into these DataSeries either as Values[0], Values[1], etc. or by using the property names (HighRay, LowRay, etc.) Usually properties of this sort are accompanied by Add statements in the Initialize method (for example, see below.)
In an indicator I wrote recently, I found that the only things I could get to display in the NinjaTrader DataBox were dataseries values in dataseries that were added in the Initialize method. Apparently it's not enough for a DataSeries to just be public ... they have to be Add'ed too.
Something like this...
I colored them white so they wouldn't mess up the scaling of other dataseries which I wanted to display (making them Transparent seemed to prevent display in the DataBox.)
I also found that if more than 10 dataseries were added in Initialize, only the first 10 would display in the DataBox.
A better place for the array initialization code would probably be in OnStartUp() but it won't help the issue of displaying in the DataBox.
If you want to display in the DataBox, I think you're going to have to "Add" a dataseries and then populate it for each bar so when you mouse-over a bar, you can see the values you set into the Added dataseries in the DataBox. In the indicator I made last week, I added 10 dataseries Add statements to its Initialize method and then filled in values from OnBarUpdate - for debugging purposes.
Best way to use swing rays is to modify the code as a function in your strategy.
In my strategy for example, the code has been completely rewritten and at any given time i have all the swing highs and lows for 28 forex currency pairs!!!
I use the SwingRay indicator and would like to do a project using it. I would like to create dymanic trendlines connecting the previous high/lows of an indicator (like Macd) with those of price. The other thought is to have the slope displayed on each trendline (one for price and one for the indicator). This would give a constant update of potential divergences.
Any sharing of previous work would be appreciated. Of course I would share the code during and on completion of any progress/solutions I come up with.
If you are referring to my post, the code has been already shared in form of the indicator. If you want to work on a new project you gotta be able to extract, and modify that simple code for your needs. I don't see how could mine completely rewritten code help you, which is btw far more complex and advanced, written in special way and much harder to understand.
I noticed a little glitch in SwingRays and as ryanb has been off the forum for some months, I decided to write here. Im including a screenshot of what happens sometimes. Does anybody have any hints on how to fix this?
The issue is that sometimes, when a swingray is broken, it is displayed still as unbroken. An example of a such a swingray is included.