Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Gap Up/Down Alert
Collapse
X
-
I see -thanks for posting the error message. This is the issue you are running into here:
One way to resolve is by adding this to top of OnBarUpdate()
if (CurrentBar < 1) return;
Your condition is also fairly restrictive, so after resolving the errors it's also possible there are no stocks that meet the condition.Ryan M.NinjaTrader Customer Service
Comment
-
Good to hear it's working. This design works great for market analyzer, but could be improved if your goal is to use it on a chart along with other indicators.
Instead of setting plots as 1 or 0, you can consider some other highlighting technique, like with drawing objects, changing bar color, chart background. This sample can help with using drawing objects:
Ryan M.NinjaTrader Customer Service
Comment
-
What is your goal here? The piece of code we've been working on has its place pretty much only on the market analyzer, as there are better ways of highlighting your condition on a chart.
I'm not sure yet the benefit you would get copying and pasting it into another indicator that returns meaningful values, or what specific problem you're having.
Also you're possibly overwriting your existing plots by using it in this indicator. Value is the generic term for the first plot, but its also mapped to specific named plots.
The snippet was provided earlier just to get you started on market analyzer filter/alerts, but it may be worthwhile going through these basic indicator tutorials to get familiar with the basics and overall structure of indicator development.
Ryan M.NinjaTrader Customer Service
Comment
-
New issue. I am calling the volume within the scan and receiving the attached error. Here is my code. Also, is there a way to filter the instruments that have a position open according to a given strategy? See the volume issue below.
Code:if (CurrentBar < 1) return; if (Close[0] >= MAX(High, LongPeriod)[1] && ADX(8)[0] >= ADXStrength && VOL()[0] >= Volume || Close[0] <= MIN(Low, LongPeriod)[1] && ADX(8)[0] >= ADXStrength && VOL()[0] >= Volume && Close[0] >= ShortPriceLevel) Value.Set(1); else Value.Set(0);
Comment
-
What are Volume and ADXStrength? Could you attach the whole script (file) so we could see how its defined? Can attach either the .cs file from documents\NinjaTrader 7\bin\custom\indicator or export as zip through File > Utilities > Export NinjaScript
Also, is there a way to filter the instruments that have a position open according to a given strategy?
All position information from a NinjaScript strategy relates only to the instance that generates it. Background on this concept is available here:
Ryan M.NinjaTrader Customer Service
Comment
-
-
Thanks for posting the script. For your input, you will want to match the type to what you're comparing. For Volume this will be Long. Please see the attached script, with this changed.
"Volume" is reserved in some places, so would want to use a modifier for the input name, like MyVolume in the attached script.
To import use File > Utilities > Import NinjaScript and select the .zip file.Attached FilesRyan M.NinjaTrader Customer Service
Comment
-
Originally posted by aktrdr071 View PostHow can I set an Market Analyzer alert for a instrument that opens above yesterday's high price or opens below yesterdays low????!!! I have been searching the help guides and other forum posts to no avail. Any help is appreciated!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by needsomehelp147, 04-29-2024, 06:43 AM
|
2 responses
19 views
0 likes
|
Last Post Today, 06:59 PM | ||
Started by sidlercom80, 10-28-2023, 08:49 AM
|
177 responses
2,400 views
0 likes
|
Last Post
by jeronymite
Today, 06:43 PM
|
||
Started by algospoke, Today, 06:36 PM
|
0 responses
6 views
0 likes
|
Last Post
by algospoke
Today, 06:36 PM
|
||
Started by ETFVoyageur, Yesterday, 06:05 PM
|
8 responses
53 views
0 likes
|
Last Post
by ETFVoyageur
Today, 06:35 PM
|
||
Started by futtrader, 04-21-2024, 01:50 AM
|
7 responses
69 views
0 likes
|
Last Post Today, 06:31 PM |
Comment