daily 5-day-SMA on 5-minute chart. - NinjaTrader Programming | futures io social day trading
futures io futures trading


daily 5-day-SMA on 5-minute chart.
Updated: Views / Replies:4,135 / 15
Created: by tranta Attachments:8

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
 8  
 
Thread Tools Search this Thread
 

daily 5-day-SMA on 5-minute chart.

  #1 (permalink)
Elite Member
Česká republika
 
Futures Experience: Beginner
Platform: NT
Favorite Futures: Forex
 
tranta's Avatar
 
Posts: 5 since Nov 2012
Thanks: 4 given, 1 received

daily 5-day-SMA on 5-minute chart.

Hi, Im trying code daily 5-day-SMA on 5-minute chart, but it doesnt work, it doesnt show anything on 5minChart
could anybody help me please?

Log:
28.1.2014 16:18 Default Error on calling 'OnBarUpdate' method for indicator 'DenniSMA' on bar 1: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

Code:

#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(PeriodType.Day, 1);
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
Overlay = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()

{ if(CurrentBar < 1)
return;


// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(SMA(Closes[1], 5)[0]);
}

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
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received



tranta View Post
Hi, Im trying code daily 5-day-SMA on 5-minute chart, but it doesnt work, it doesnt show anything on 5minChart
could anybody help me please?

Log:
28.1.2014 16:18 Default Error on calling 'OnBarUpdate' method for indicator 'DenniSMA' on bar 1: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

Code:

#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(PeriodType.Day, 1);
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
Overlay = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()

{ if(CurrentBar < 1)
return;


// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(SMA(Closes[1], 5)[0]);
}

Do you have enough days back loaded on your base dataseries. You will need several days back to load.

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
 
  #4 (permalink)
Elite Member
Česká republika
 
Futures Experience: Beginner
Platform: NT
Favorite Futures: Forex
 
tranta's Avatar
 
Posts: 5 since Nov 2012
Thanks: 4 given, 1 received


Tasker_182 View Post
Do you have enough days back loaded on your base dataseries. You will need several days back to load.

50 days back

Reply With Quote
 
  #5 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received


tranta View Post
50 days back

There is an easier way than writing an indicator to do this. Here is what i did for the chart below.

1) Created new chart with 50 days of 5 minute data.
2) Added another data series, daily, 50 days
3) for the daily data series change the following: (see picture)
A) Set the type to "line on close"
B) Set the color to "transparent"
C) Set the panel to panel #1 (important!!)
D) Turn off the "Plot executions"
E) hit Okay, You will now have a chart showing only the 5 minute data (see picture)

4) open the indicators, select SMA. In the indicator panel change the input series to the daily data series. (See picture)

You now have an sma(5) from daily bars showing on a 5 minute data chart.

Hope this helps.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
The following user says Thank You to Tasker_182 for this post:
 
  #6 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received


tranta View Post
Hi, Im trying code daily 5-day-SMA on 5-minute chart, but it doesnt work, it doesnt show anything on 5minChart
could anybody help me please?

Log:
28.1.2014 16:18 Default Error on calling 'OnBarUpdate' method for indicator 'DenniSMA' on bar 1: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

Code:

#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(PeriodType.Day, 1);
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
Overlay = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()

{ if(CurrentBar < 1)
return;


// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(SMA(Closes[1], 5)[0]);
}


Programmatically speaking, you need to wait for 5 daily bars to process before you can get the SMA(5) to work. So you might change your

if (CurrentBar <1)

to

if CurrentBars[1] < 5) return ;

CurrentBars[1] is the way to refer to the added data series.

Hope that helps

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
The following user says Thank You to Tasker_182 for this post:
 
  #7 (permalink)
Elite Member
Česká republika
 
Futures Experience: Beginner
Platform: NT
Favorite Futures: Forex
 
tranta's Avatar
 
Posts: 5 since Nov 2012
Thanks: 4 given, 1 received


Tasker_182 View Post
There is an easier way than writing an indicator to do this. Here is what i did for the chart below.

1) Created new chart with 50 days of 5 minute data.
2) Added another data series, daily, 50 days
3) for the daily data series change the following: (see picture)
A) Set the type to "line on close"
B) Set the color to "transparent"
C) Set the panel to panel #1 (important!!)
D) Turn off the "Plot executions"
E) hit Okay, You will now have a chart showing only the 5 minute data (see picture)

4) open the indicators, select SMA. In the indicator panel change the input series to the daily data series. (See picture)

You now have an sma(5) from daily bars showing on a 5 minute data chart.

Hope this helps.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Attachment 135112
Attachment 135114

Its smart solution, but I need code indicator, I want to use that in strategies.

Reply With Quote
 
  #8 (permalink)
Elite Member
Česká republika
 
Futures Experience: Beginner
Platform: NT
Favorite Futures: Forex
 
tranta's Avatar
 
Posts: 5 since Nov 2012
Thanks: 4 given, 1 received


Tasker_182 View Post
Programmatically speaking, you need to wait for 5 daily bars to process before you can get the SMA(5) to work. So you might change your

if (CurrentBar <1)

to

if CurrentBars[1] < 5) return ;

CurrentBars[1] is the way to refer to the added data series.

Hope that helps

Thank zou verz much. It works finallz

Reply With Quote
The following 2 users say Thank You to tranta for this post:
 
  #9 (permalink)
Elite Member
Edmonton, Alberta
 
Futures Experience: Advanced
Platform: IB
Favorite Futures: nq
 
Posts: 55 since Jan 2012
Thanks: 27 given, 57 received

If you want to keep things simple you can just convert a 5 sma on a daily to the 5 minute chart :

There are twelve 5 minute periods per one hour multiplied by twenty-four hour per day multiplied by five days (12x24x5 = 288)

So a daily 5 SMA is roughly equivalent to a 288 SMA on a five minute chart (assuming your chart is a 24hr chart). Only a few ticks difference between them.


Last edited by gfmatt; January 28th, 2014 at 09:10 PM. Reason: mistake
Reply With Quote
The following user says Thank You to gfmatt for this post:
 
  #10 (permalink)
Market Wizard Apprectice
New York City, USA
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: ES, CL, 6E
 
futurestrader1's Avatar
 
Posts: 147 since Jul 2010
Thanks: 81 given, 40 received

Need a true Daily SMA


It would be nice if the 288SMA would be the same on a 5min chart as a true daily sma on a same chart.
I use NT and ThinkOrSwim. TOS has a Daily SMA indicator built in and it is awesome. Why doesn't NT have it also.

The use of the Daily SMA is what Brian Shannon uses for his day trading and it is a great aid.

Is there a Daily SMA available as a free indicator for NinjaTrader? I would love to see it!

Reply With Quote

Reply



futures io > > > > > daily 5-day-SMA on 5-minute chart.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom daily indicator that using 1-minute info (Pascal Willain - Effective Volume) sagor NinjaTrader 18 June 27th, 2014 05:25 PM
Display Daily SMA within Renko chart foodchain NinjaTrader Programming 6 May 2nd, 2012 09:03 PM
Using 2 different datasets: entry on Daily, manage on 1 minute spinnybobo NinjaTrader 3 February 13th, 2012 06:12 AM
Bad daily/minute data for E-Mini? Xyzzy Reviews of Brokers and Data Feeds 7 November 8th, 2011 08:53 PM
can daily&weekly indy work from monthly SMA in MA? nt6.5 mystiq NinjaTrader 4 February 27th, 2011 11:40 AM


All times are GMT -4. The time now is 10:09 AM.

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-17 in 0.15 seconds with 20 queries on phoenix via your IP 107.20.115.174