if (Volume[0] < Volume[1] * 0.250)
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Volume Alert Indicator
Collapse
X
-
Volume Alert Indicator
Hi Everyone! I new to NinjaTrader and am trying to create just a basic indicator that I can put into Market Analyzer and run against an instrument list. All I'm trying to do is get an alert if the next bar is GT last bar by lets say by 250%. Here is what I have in the Indicator and it just doesn't seem to be working. I have the indicator in a column in Market Analyzer, on a 3 minute value, # of bars to look back 5, Price Type Close, and a Alert Condition set of value of 0. Am I doing this correctly? Thanks Joy
if (Volume[0] < Volume[1] * 0.250)Tags: None
-
Hello Joy,
Welcome to the NinjaTrader Support Forums!
Just to make sure that I am understanding you correctly you are looking for an Alert when the next bar's volume is 250% "GT" (Greater Than?) than the previous one?
If that is the case then you may try something like:
if ( (2.5 * Volume[0]) > Volume[1] )
// Do something.
Let me know if you get better results with this.JCNinjaTrader Customer Service
-
Hi,
Thanks! Yes, that's what I am trying to do. I will try that tomorrow during market hours and let you know if that works.
Comment
-
Volume Alert Indicator
Hi, I put the code you suggested in the Indicator. What do I select in the Market Analyzer Column Trigger condition? If I have the Alert Coded in the Indicator, what do I put for Condition and Value? Which one overrides the other? Do I take the alert out of the indicator script and set the value in the trigger? Their are volume numbers showing up in the column, shouldn't these be a 1 or 0? Sorry, just a little confused here. Thanks Joy
Comment
-
Hello Joy,
Using the Market Analyzer to trigger your Alerts, you would want to set a "Plot" value a static number like 0 or 1 as you mentioned. So that when your Plot is 1 your Alert is triggered, but when its 0 it is not true.
So when you do something like:
if ( (2.5 * Volume[0]) > Volume[1] )
{
Value.Set(1);
}
else
{
Value.Set(0);
}
Then inside of the Alert Conditions you may check if the Plot is equal to 1 to trigger your alert.
Let me know if you have any questions.JCNinjaTrader Customer Service
Comment
-
Volume Alert Indicator
Hi, I put this in and I'm getting Statement Expected after Value.Set(1); I don't know what I am missing. Thanks for your help already!
{
if ((.250 * Volume[0]) > Volume[1] > 150000))
{
Value.Set(1);
}
else
{
Value.Set(0);
}
}
Comment
-
Here is the copy/pasted code: I'm getting an error after the Else. Something is not right. Please help. thanks Joy
protected override void OnBarUpdate()
{
if ((.250 * Volume[0]) > Volume[1] && Volume[0] > 150000))
{
Value.Set(1);
}
else
{
Value.Set(0);
}
{
//Alert("MyAlert3044", Priority.High, "MyVolumeAlert", @"C:\Program Files\NinjaTrader 7\sounds\AutoChase.wav", 60, Color.DodgerBlue, Color.White);
}
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
}
#region Properties
#endregion
}
}
Comment
-
I changed the code to read list this: However, I do not see 1 and 0 in the columns.
protected override void OnBarUpdate()
{
if ((.250 * Volume[0]) > Volume[1] && Volume[0] > 150000))
{
Value.Set(1);
}
if ((.250 * Volume[0]) > Volume[1] && Volume[0] < 150000))
{
Value.Set(0);
}
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
}
#region Properties
#endregion
}
}
Comment
-
-
Howdy there,
why i cant compare the current volume with the volume x bars ago?For e.g.,here`s a formula that compars the two adjacent vol bars:
Volume[0] >Volume[1]
If i want to compare the x bars ago,it renders a blank chart.
Why can`t i compare,let`s say the current volume bar with the 1000 th bar ago,like this?:
Volume[0] >Volume[1000]
??
Any suggestions?
Comment
-
Originally posted by cachevery View PostHowdy there,
why i cant compare the current volume with the volume x bars ago?For e.g.,here`s a formula that compars the two adjacent vol bars:
Volume[0] >Volume[1]
If i want to compare the x bars ago,it renders a blank chart.
Why can`t i compare,let`s say the current volume bar with the 1000 th bar ago,like this?:
Volume[0] >Volume[1000]
??
Any suggestions?
Open the output window. You should have an error there?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by samish18, Today, 10:13 AM
|
0 responses
2 views
0 likes
|
Last Post
by samish18
Today, 10:13 AM
|
||
Started by kenz987, Yesterday, 10:20 AM
|
2 responses
12 views
0 likes
|
Last Post
by kenz987
Today, 10:13 AM
|
||
Started by nicthe, 08-23-2023, 07:53 AM
|
7 responses
196 views
0 likes
|
Last Post
by nicthe
Today, 09:26 AM
|
||
Started by nicthe, Today, 09:24 AM
|
0 responses
5 views
0 likes
|
Last Post
by nicthe
Today, 09:24 AM
|
||
Started by stalt, 12-28-2015, 01:36 PM
|
6 responses
1,536 views
0 likes
|
Last Post
by giulyko00
Today, 09:16 AM
|
Comment