![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Aug 2008
Posts: 233
Thanks: 19
Thanked 5 times in 5 posts
|
Hi,
I have an indicator looking for a condition which appears to be working as I have the if statement followed by a print which when the if statement is true I am seeing the correct output as per the code below; Code:
This is when the code was working correctly;
if (BarsInProgress == 0)
{
if (GetCurrentBidVolume(0) > GetCurrentAskVolume(1))
print(GetCurrentBidVolume(0) + " " + GetCurrentAskVolume(1))
}
Code:
if (BarsInProgress == 0)
{
if (GetCurrentBidVolume(0) > GetCurrentAskVolume(1))
print(GetCurrentBidVolume(0) + " " + GetCurrentAskVolume(1))
DrawDot("Plot0", false, 0, High[0] + 1, Color.WhiteSmoke);
}
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
suprsnipes, you extended your if ( ) condition beyond using a single line, so you would need to use the { } braces around it -
Code:
if (BarsInProgress == 0)
{
if (GetCurrentBidVolume(0) > GetCurrentAskVolume(1))
{
print(GetCurrentBidVolume(0) + " " + GetCurrentAskVolume(1))
DrawDot("Plot0", false, 0, High[0] + 1, Color.WhiteSmoke);
}
}
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2008
Posts: 233
Thanks: 19
Thanked 5 times in 5 posts
|
Could you please confirm that for DrawDot etc there is no need to use Add() in the Initialize section?
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Correct, that's not need to work with DrawDot() per se, only if you would want to add
a) bars series for programmatic access b) indicators for display in strategies c) adding a plot / line (which does not relate to the drawing methods)
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Aug 2008
Posts: 233
Thanks: 19
Thanked 5 times in 5 posts
|
Appreciate it your quick response as always, thanks
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running strategies with connection loss handling set to 'recalculate' causing problem | adamus | Automated Trading | 8 | 03-29-2011 03:01 AM |
| DrawDot help | upsndowns | Indicator Development | 1 | 05-19-2010 07:34 AM |
| DrawDot... | Mark- | General Programming | 29 | 03-03-2009 08:32 PM |
| DrawDot | rurimoon | General Programming | 5 | 01-24-2009 08:35 AM |
| DrawDot() | NinjaTrader_Josh | Indicator Development | 9 | 03-26-2008 07:51 AM |