Multi Time Frame Clarification - NinjaTrader | futures io social trading
futures io futures trading


Multi Time Frame Clarification
Updated: Views / Replies:224 / 1
Created: by resirca52009 Attachments:5

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 Time Frame Clarification

  #1 (permalink)
Elite Member
Indianapolis, Indiana/ USA
 
Futures Experience: Advanced
Platform: MT4, Ninjatrader
Broker/Data: AMP / CQG
Favorite Futures: Futures
 
Posts: 45 since Oct 2012
Thanks: 109 given, 11 received

Multi Time Frame Clarification

Can someone clarify the following for me. See my text annotations scattered throughout :

Below is the code from the NT 7 Sample Multi Time Frame

public class SampleMultiTimeFrame : Strategy
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
// Add a 5 minute Bars object to the strategy
Add(PeriodType.Minute, 5);

// Add a 15 minute Bars object to the strategy
Add(PeriodType.Minute, 15);

// Note: Bars are added to the BarsArray and can be accessed via an index value
// E.G. BarsArray[1] ---> Accesses the 5 minute Bars object added above

// Add simple moving averages to the chart for display
// This only displays the SMA's for the primary Bars object on the chart
Add(SMA(5));
Add(SMA(50));

CalculateOnBarClose = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// OnBarUpdate() will be called on incoming tick events on all Bars objects added to the strategy
// We only want to process events on our primary Bars object (index = 0) which is set when adding
// the strategy to a chart
if (BarsInProgress != 0)
return; //So I set the strategy on a 30 minute chart; this becomes the primary series.

// Checks if the 5 period SMA is above the 50 period SMA on both the 5 and 15 minute time frames
if (SMA(BarsArray[1], 5)[0] > SMA(BarsArray[1], 50)[0] && SMA(BarsArray[2], 5)[0] > SMA(BarsArray[2], 50)[0])
{
// Checks for a cross above condition of the 5 and 50 period SMA on the primary Bars object and enters long
if (CrossAbove(SMA(5), SMA(50), 1))
EnterLong(1000, "SMA");
}
// This states below that the 5 and 15 period SMA on the 15 minute time frame but the code says 5 and 50 period SMA
//on the 15 minute time frame, minor typo, the code appears legitimate.
// Checks for a cross below condition of the 5 and 15 period SMA on the 15 minute time frame and exits long
if (CrossBelow(SMA(BarsArray[2], 5), SMA(BarsArray[2], 50), 1))
ExitLong(1000);
}

#region Properties
#endregion

See my screen shots below which highlight my confusion :

I could not get my multi time frame code to work so I decided to go back and
test the Sample Multi Frame code in NT from which I drew my inspiration.
Here a trade is fired off on 12/18 @ 6pm on the primary series ( 30 min ).
All code seems correct for the entry -
Inline image 1


// Checks if the 5 period SMA is above the 50 period SMA on both the 5 and 15 minute time frames
if (SMA(BarsArray[1], 5)[0] > SMA(BarsArray[1], 50)[0] && SMA(BarsArray[2], 5)[0] > SMA(BarsArray[2], 50)[0])

The prior code statement is validated by the next two screen shots :
5 minute - 12/18 @ 6 pm
Inline image 2


15 minute - 12/18 @ 6 pm
Inline image 3

What I am confused about is the exit.According to the following code :

// Checks for a cross below condition of the 5 and 15 ( supposed to say 50 ) period SMA on the 15 minute time frame and exits long
if (CrossBelow(SMA(BarsArray[2], 5), SMA(BarsArray[2], 50), 1))
ExitLong(1000);

This should exit when the 5 SMA crosses below the 50 SMA on the 15 minute
time frame. You can see below on the primary series chart it runs for several days.

Inline image 4


In the following screenshot the 5 SMA color has been changed to Fuschia
for clarity. You can see that the 5 SMA crosses below the 50 SMA on the
15 minute time frame at approx 5:15 am on the 19th and not the 21st as
shown on the primary series ( 30 min ). Am I misinterpreting something here
or is there another issue ?



Inline image 5

Thanks for your time and help,
Richard

Reply With Quote
 
  #2 (permalink)
Elite Member
Indianapolis, Indiana/ USA
 
Futures Experience: Advanced
Platform: MT4, Ninjatrader
Broker/Data: AMP / CQG
Favorite Futures: Futures
 
Posts: 45 since Oct 2012
Thanks: 109 given, 11 received

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).

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).

Reply With Quote

Reply



futures io > > > > Multi Time Frame Clarification

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

July Journal Challenge w/$1100 in prizes from TopstepTrader

July

John @ No BS Day Trading (TBA)

Elite only

An Afternoon with FIO member Softsoap (being rescheduled)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stochastics multi time frame ? curleta NinjaTrader 3 September 24th, 2015 06:23 AM
multi time frame indicator lags microsat NinjaTrader Programming 5 September 21st, 2015 11:16 AM
R Quantstrat and multi time frame pipsalottle Matlab, R project and Python 3 June 2nd, 2015 08:51 PM
multi time-frame questions -- this is different balance NinjaTrader Programming 4 January 12th, 2013 02:27 AM
ADX Multi Time Frame bellair NinjaTrader 9 November 10th, 2011 10:14 AM


All times are GMT -4. The time now is 01:22 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-06-27 in 0.09 seconds with 25 queries on phoenix via your IP 54.80.124.245