Multi-timeframe code with Minute and SbSRenko - NinjaTrader Programming | futures io social day trading
futures io futures trading


Multi-timeframe code with Minute and SbSRenko
Updated: Views / Replies:887 / 9
Created: by traderjh Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Multi-timeframe code with Minute and SbSRenko

  #1 (permalink)
Elite Member
South Jordan UT
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Forex
 
Posts: 15 since Jan 2013
Thanks: 6 given, 1 received

Multi-timeframe code with Minute and SbSRenko

Hello,

I am not sure how to code both Minute frame as BarsInProcess = 0 and SBSRenko as BarsInProcess = 1 together. I also am not familiar with setting up Add(PeriodType.Custom....) for SBSRenko.

Do you have an example of code like this or is there a strategy/indicator somewhere here that I can learn from?

I appreciate your reply.

Many thanks,
-traderjh

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received


BarsInProgress, just add each one and the first one listed will be BarsInProgress == 1, second one will be BarsInProgress == 2, etc. The underlying chart data will be BarsInProgress == 0. If this doesn't make sense, search NT help file for BarsInProgress and it will show more detail.

See this thread for custom types. https://futures.io/ninjatrader-programming/11809-ninjatrader-7-list-used-barstype-base-periodtype.html

Reply With Quote
The following user says Thank You to vegasfoster for this post:
 
  #4 (permalink)
Elite Member
South Jordan UT
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Forex
 
Posts: 15 since Jan 2013
Thanks: 6 given, 1 received


vegasfoster View Post
BarsInProgress, just add each one and the first one listed will be BarsInProgress == 1, second one will be BarsInProgress == 2, etc. The underlying chart data will be BarsInProgress == 0. If this doesn't make sense, search NT help file for BarsInProgress and it will show more detail.

See this thread for custom types. https://futures.io/ninjatrader-programming/11809-ninjatrader-7-list-used-barstype-base-periodtype.html


Thank you for your reply.

I coded a simple strategy to display OHLC on both Minute and SbSRenko. Minute OHLC data is showing good but SbSRenko is not showing. I added SbSRenko into Data Series and it is still not showing. What am I missing here? See code below:

 
Code
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    [Description("")]
    public class DisplayOHLC : Strategy
    {
        #region Variables
        #endregion
        protected override void Initialize()
        {
            CalculateOnBarClose = true;
		Add(PeriodType.Minute,60);
		Add(PeriodType.Custom6,300);
        }
        protected override void OnBarUpdate()
        {
			if (BarsInProgress == 0)
			{
				DrawTextFixed("MinuteOHLC",
				"O:" + Opens[0][0]	
				+"\nH:" + Highs[0][0]
				+"\nL:" + Lows[0][0]
				+"\nC:" + Closes[0][0]
				,TextPosition.TopLeft,Color.Yellow,new Font("Arial", 9),Color.Black,Color.Black,10);
			}
			if (BarsInProgress == 1)
			{
				DrawTextFixed("RenkoOHLC",
				"O:" + Opens[0][1]
				+"\nH:" + Highs[0][1]
				+"\nL:" + Lows[0][1]
				+"\nC:" + Closes[0][1]
				,TextPosition.BottomLeft,Color.Yellow,new Font("Arial", 9),Color.Black,Color.Black,10);
			}
        }

        #region Properties
        #endregion
    }
}

Reply With Quote
 
  #5 (permalink)
Elite Member
South Jordan UT
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Forex
 
Posts: 15 since Jan 2013
Thanks: 6 given, 1 received

Previous reply

Silly me!!

It now works! I just fixed that mistake from [0][1] to [1][0].

Thanks again!!

-traderjh

Reply With Quote
 
  #6 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

Ok, its been a while and I was thinking the minute would need to be BarsInProgress ==1 and the better renko would need to be BarsInProgress == 2, but if its working then I guess not

Reply With Quote
 
  #7 (permalink)
Elite Member
South Jordan UT
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Forex
 
Posts: 15 since Jan 2013
Thanks: 6 given, 1 received

not in sync


vegasfoster View Post
Ok, its been a while and I was thinking the minute would need to be BarsInProgress ==1 and the better renko would need to be BarsInProgress == 2, but if its working then I guess not

It does display the values but they are not in sync with those data in Data Box window. Again, I am missing something here. :-(

Reply With Quote
 
  #8 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

I just read the help file, and if the 60 minute data is not your base chart, then it needs to be BarsInProgress==1 and the better renko needs to be BarsInProgress==2. Other thing is a 300 better renko is a huge setting, are you sure that's the correct number?

Reply With Quote
 
  #9 (permalink)
Elite Member
South Jordan UT
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Forex
 
Posts: 15 since Jan 2013
Thanks: 6 given, 1 received


vegasfoster View Post
I just read the help file, and if the 60 minute data is not your base chart, then it needs to be BarsInProgress==1 and the better renko needs to be BarsInProgress==2. Other thing is a 300 better renko is a huge setting, are you sure that's the correct number?

300 better renko is actually 30 when I set the Control Center's pip quote setting to 1/10.

What I am trying to achieve is to use 60 minute chart for handling orders and to call data from better renko's open/close prices for checking the conditions. Which is more sense to use 2 Add()s for minutes and better renko in 60 minute chart like you mentioned above (1 and 2) or just one Add() with better renko in 60 min chart with BarsInProgress==0 and BarsInProgress==1?

In the code from earlier post, I was trying to retrieve live prices to make sure I coded properly but they seems not in sync with data box.

Thanks for the clarification,
-traderjh

Reply With Quote
 
  #10 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received


If 60 minutes is your base chart, then I am not really sure. You can try commenting out the line "Add(PeriodType.Minute,60);" and see if it changes anything. If not, then I guess it doesn't matter and I have no other unhelpful suggestions for you try.

Reply With Quote
The following user says Thank You to vegasfoster for this post:

Reply



futures io > > > > > Multi-timeframe code with Minute and SbSRenko

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi timeframe programming in Easylanguage buylosellhi EasyLanguage Programming 11 December 20th, 2014 05:27 AM
NT Multi Timeframe and multi indicator review eurostoxx NinjaTrader 3 August 29th, 2011 01:07 PM
Multi Timeframe Price Indicator michaelf NinjaTrader 1 March 17th, 2011 01:07 PM
Multi-Timeframe in a strategy max-td NinjaTrader Programming 30 July 22nd, 2010 01:35 PM
sensitivity multi-timeframe trick (small timeframe on bigger one) SARdynamite NinjaTrader Programming 4 July 15th, 2010 03:57 PM


All times are GMT -4. The time now is 11:04 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.12 seconds with 19 queries on phoenix via your IP 54.145.16.43