![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2008
Posts: 310
Thanks: 0
Thanked 0 times in 0 posts
|
Hi everyone
I'm currently using the BBS indicator that I downloaded here. I'd like to use it to set up an automated strategy, but how should I do exactly? The BBS indicator returns dots and arrows, not values. I read this into the code: To get BBS dot values use : // BBS(2,1.5,20).DotValues.Get(CurrentBar) // Possible dot values are '0' for no data, '2' for squeeze alert, '1' for squeeze on, and '-1' for squeeze off So I guess I should use value 1 for entries and value -1 for exits? What about the direction of the trades? Many thanks in advance |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
You would need to contact the author and ask him for clarification on the meaning of the values provided.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
|
I haven't tried it, but I think it would be something like this to place trades where the little green arrows are positioned....
Code:
if (BBS(2,1.5,20).DotValues[0] == 2)
{
if (BBS(2,1.5,20).BarValues[0] < 0)
{
// Go long
}
else
{
// Go short
}
}
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Apr 2008
Posts: 310
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you very much, KBJ.
How would you write the code for the exit conditions (two darker bars in a row)? Many thanks again |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
|
Hi stefy,
A squeeze indicates indecision in the market, so the theory goes that you enter a trade once the squeeze is off (-1 DotValue) in the direction of the bars, or any other indicator you care to use... |
|
|
|
|
|
#6 |
|
Member
Join Date: Aug 2009
Posts: 48
Thanks: 3
Thanked 0 times in 0 posts
|
Stefy, Did you ever get this to work? I'm trying to do the same but am confused about how to use an indicator from within a strategy. I have the BBS Squeeze indicator. It's an object, not a method. I thought that I would need to construct an instance of the BBS Squeeze in the strategy Initialize() method and call properties on the squeeze object. But I see from this thread you're using a BBS method. How can that work? Where is this method? Why don't you need to hold the object? Doesn't the object maintain state? See my thread on this matter here: http://www.ninjatrader-support2.com/...479#post116479
Thanks, Tim |
|
|
|
|
|
#7 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Tim,
All indicators can be called like methods. What state are you trying to maintain? For instance, take the SMA indicator. To access SMA values just go SMA(20)[0]. For BB Squeeze (this is just my guess as to what this indicator is/does) you could go BBSqueeze(some parameters).SomePlot[0]
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#8 | |
|
Senior Member
Join Date: Apr 2008
Posts: 310
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Brillo,
It was some time ago, but I was calling the "Dot Values" in the BBS Squeeze (which can be 0, 1, 2) like this: BBS(2,1.5,20).DotValues[0] and the BarValues like this: BBS(2,1.5,20).BarValues[0] I hope I answered your question, otherwise feel free to ask for more. Have a nice day, Stefy Quote:
|
|
|
|
|
|
|
#9 |
|
Member
Join Date: Aug 2009
Posts: 48
Thanks: 3
Thanked 0 times in 0 posts
|
Hi Stefy, Thank you. I understand it better now. The NinjaScript generated code at the bottom of the indicator source file adds some methods to the Indicator class that allow you to construct the indicator using function like syntax. That same code binds it to the Input dataseries. There's also an overload to bind it to an arbitrary DataSeries object you pass in.
Tim |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Want to test strategy based on time and fair value | cassb | Strategy Development | 3 | 02-20-2008 09:57 AM |
| Strategy based on indicator value, not price? | cassb | Strategy Analyzer | 2 | 12-19-2007 06:44 AM |
| Strategy based on Fast Stochastics | Trader Rob | Strategy Development | 3 | 10-29-2007 09:51 PM |
| Need help with strategy based on Simulated stop | vking | ATM Strategies (Discretionary Trading) | 9 | 10-18-2007 06:27 AM |
| coloring indicator based upon price parameters | Thomas | Indicator Development | 10 | 08-28-2007 11:44 AM |