NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-14-2009, 04:26 AM   #1
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default orders placed according to color of bars

Is it possible to have long/short orders to be placed according
to the color of the price bars on a chart? Or does one have
to code every single thing into a strategy as to how the price
bars have been given their color?
stephenszpak is offline  
Reply With Quote
Old 06-14-2009, 10:24 AM   #2
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,


There is not function to place order per the color of the bar, sorry.
NinjaTrader_Ben is offline  
Reply With Quote
Old 06-14-2009, 10:36 AM   #3
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Thanks Ben. I am thinking about a strategy
using Renko bars. Would I have to code the
parameters of a Renko bar, that is, within the strategy?
If you know of this being done I'd appreciate the
link.
Last edited by stephenszpak; 06-14-2009 at 11:51 AM.
stephenszpak is offline  
Reply With Quote
Old 06-14-2009, 03:30 PM   #4
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

You can code this within the strategy or create an indicator that a plot that is accessable to your strategy.

I recommend searching the forum with the search feature and/or looking in the file sharing section of the forum.
NinjaTrader_Ben is offline  
Reply With Quote
Old 06-14-2009, 11:04 PM   #5
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Ben

Ok, just to make sure about this. If I format the data series
to Renko and create a 4 tick chart, will a Ninja Strategy accept
the closing prices created by the Renko as valid,that is, just as valid
as if it were a standard bar chart? You said somewhere that Renko
is not a supported capability of NT.
(Sorry, I'm positive this is a simple question, but I just don't know.)


I just found this on page 484 of the manual.


{
// Add a 5 minute Bars object - BarsInProgress index = 1
Add(PeriodType.Minute, 5);
// Add a 100 tick Bars object for the ES 12-06 contract - BarsInProgress
index = 2
Add("ES 12-06", PeriodType.Tick, 100);
// Charts a 20 period simple moving average to the chart
Add(SMA(20));
}

{
Maybe something like this would be what we're talking about:
// to get 100 Renko bars
Add("ES 12-06", PeriodType.Renko, 100);
// to make the Renko a 4 tick
Add (PeriodType.Renko,4);
// to add a 3 SMA to that
Add(SMA(3));
}
Last edited by stephenszpak; 06-15-2009 at 12:14 AM.
stephenszpak is offline  
Reply With Quote
Old 06-15-2009, 06:04 AM   #6
RJay
Senior Member
 
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 13
Thanked 24 times in 18 posts
Default

Stephen,

It has been my experience that only chart types that are reconised by intellisense can be added in this manner. Renko is not one of them.

RJay
RJay is offline  
Reply With Quote
Old 06-15-2009, 08:37 AM   #7
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Unfortunately Renko bars are a 3rd party addon and we do not know if you can use them or not.

You could try just going PeriodType.Renko and see if that works. Otherwise unfortunately you would need to contact the vendor to see if they know.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-20-2009, 08:33 PM   #8
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by rt6176 View Post
Stephen,

It has been my experience that only chart types that are reconised by intellisense can be added in this manner. Renko is not one of them.

RJay
So a strategy using Renko bars is impossible?!
It doesn't seem to recognize Renko as you stated.

Any suggestions at this point would be appreciated (by anyone).
The Renko code was made by a NT person. I'll try to search who
did it. Maybe they have an idea.


Did the search. I think it was roonius. His program:

'Renko bars' is what I downloaded (I think) a number of days ago.

I found/opened his program using notepad. (I can post it if necessary.)
Should it be installed within a strategy in its entirety to create a Renko
strategy of some sort.



Thanks,

- Stephen
Last edited by stephenszpak; 06-20-2009 at 09:49 PM.
stephenszpak is offline  
Reply With Quote
Old 06-21-2009, 12:14 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,547
Thanks: 261
Thanked 1,012 times in 993 posts
Default

Stephen, is this a MultiTimeFrame / Instrument strategy you want to code up? If not you can simply run your existing strategy on the Renko bars type, there's no explicit coding to the Renko bars type needed then.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-21-2009, 12:25 AM   #10
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Stephen, is this a MultiTimeFrame / Instrument strategy you want to code up? If not you can simply run your existing strategy on the Renko bars type, there's no explicit coding to the Renko bars type needed then.
Ok...ah, it seems I was given conflicting info. At the moment it
would simply be Renko bars as a single time frame strategy.


Well to update, I just did this:

protected override void OnBarUpdate()
{

Add("ES 12-06", PeriodType.Renko, 100);

Add (PeriodType.Renko,4);

Add(SMA(3));
}

This is NOT what I want in the end, however the 'Strategy was successfully generated'.
There still is hope.
Last edited by stephenszpak; 06-21-2009 at 12:39 AM.
stephenszpak is offline  
Reply With Quote
Old 06-21-2009, 12:51 AM   #11
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,547
Thanks: 261
Thanked 1,012 times in 993 posts
Default

Stephen, for a single timeframe strategy running on Renko bars, just create your chart using the Renko bars type and run your strategy on it (for a quick demo, just use the SampleMACrossOver). You would not have to Add() the Renko bars for this to be working in a strategy using just one Renko chart.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-21-2009, 12:59 AM   #12
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

This is what I got. Nothing to see really, but it does work.
I checked the strategy's code. It doesn't specify much of
anything, so you were right, it doesn't matter.
Attached Images
File Type: jpg Renkotemochart.jpg (43.6 KB, 19 views)
stephenszpak is offline  
Reply With Quote
Old 06-21-2009, 11:45 PM   #13
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Stephen, is this a MultiTimeFrame / Instrument strategy you want to code up? If not you can simply run your existing strategy on the Renko bars type, there's no explicit coding to the Renko bars type needed then.

If I wished to develop a strategy using a short term and long term Renko
bar tick, like 3 tick and 7 tick, would this be possible?

I looked at the Renko code that actually displays the basic Renko chart and I must
say it is extremely complex and long as far as I'm concerned. Would I have to use
this code (I can post if necessary) within a two tick (7 tick and 3 tick) strategy,
or is there a much simpler way?
stephenszpak is offline  
Reply With Quote
Old 06-22-2009, 05:09 AM   #14
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,547
Thanks: 261
Thanked 1,012 times in 993 posts
Default

Stephen, as stated earlier this is a custom barstype and you would need to contact the original author to check if and how it workds in multi series environments, if you want to got with a supported one, you can check the Range bars out and Add() them via Add(PeriodType.Range, 4).
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-22-2009, 05:28 AM   #15
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Stephen, as stated earlier this is a custom barstype and you would need to contact the original author to check if and how it workds in multi series environments, if you want to got with a supported one, you can check the Range bars out and Add() them via Add(PeriodType.Range, 4).
I believe roonius wrote the program that creates Renko bars within NT.
I contacted him. Maybe it wasn't him or maybe he is occupied. No response
as yet.

Maybe I can do something with the Add() stuff. Lost my train of thought
on this as the days have past. From what you said it seems possible though.
stephenszpak is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
3 color Heiken bars stephenszpak Indicator Development 7 05-25-2009 12:46 PM
color price bars and volume bars the same mikeytrader General Programming 1 05-11-2009 07:52 AM
Color bars qkracer Indicator Development 10 12-26-2007 11:22 PM
Sma To Plot Color Bars Not Lines avlasov Indicator Development 4 12-08-2007 03:37 PM
Color Volume Bars Indicator (Download) Version 5 Only awuit Indicator Development 3 11-29-2007 04:25 PM


All times are GMT -6. The time now is 09:40 PM.