Moving Average of Data2 - EasyLanguage Programming | futures io social day trading
futures io futures trading


Moving Average of Data2
Updated: Views / Replies:530 / 5
Created: by kristian 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
 

Moving Average of Data2

  #1 (permalink)
Trading Apprentice
Zurich
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: $CL
 
Posts: 6 since Aug 2015
Thanks: 4 given, 1 received

Moving Average of Data2

I have a strategy on Data1 (15M chart) with a simple moving average filter using Data2 (daily chart). Long trades are only taken when above the 100-day MA and short trades only when it is below.

The strange thing is that I get different (better) results when using the close of data2 instead of the normal close (of data1).

Below is some code to clarify what I mean:

 
Code
	
Condition7 = Close > Value2; // Profit Factor 1.53
 
Code
	
Condition7 = Close of Data2 > Value2; // Profit Factor 2
*Value2 being the value of the moving average

Shouldn't the results be the same? Is the 2nd code looking into the future?

Thanks for your help!


Last edited by kristian; November 9th, 2015 at 05:33 PM.
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)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received



kristian View Post
I have a strategy on Data1 (15M chart) with a simple moving average filter using Data2 (daily chart). Long trades are only taken when above the 100-day MA and short trades only when it is below.

The strange thing is that I get different (better) results when using the close of data2 instead of the normal close (of data1).

Below is some code to clarify what I mean:

 
Code
	
Condition7 = Close > Value2; // Profit Factor 1.53
 
Code
	
Condition7 = Close of Data2 > Value2; // Profit Factor 2
*Value2 being the value of the moving average

Shouldn't the results be the same? Is the 2nd code looking into the future?

I don't think I follow you: if Data1 is a 15-minute chart and Data2 is a daily chart, isn't it to be expected that `Close` (of data 1) gives a different value than `Close of Data2`?

Only once per day is `Close` the same as `Close of data2`, and that's when the 15-minute bar is the last bar of the day. But for all other bars I'd say it's normal to have a difference between them. Or do you use intra-bar order generation and the Bar Magnifier feature?

Reply With Quote
The following user says Thank You to Jura for this post:
 
  #4 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Close Data2 is likely the last closed bar on your chart (yesterday) where Close is the last closed bar on the 15 minute chart. This is assuming the absence of intrabar order generation.
Therefore the results can and will be different, like @Jura pointed out, too. One good way of checking things and seeing the difference can be using the Print command and the output window to show the actual values for Close, Close Data2 and Value2.
On a side note I'd suggest to start using meaningful variable names as this can help you in the future. With variables you declare you can actually tie them to certain datastreams, which you can't do with Value2.

Regards,
ABCTG



kristian View Post
I have a strategy on Data1 (15M chart) with a simple moving average filter using Data2 (daily chart). Long trades are only taken when above the 100-day MA and short trades only when it is below.

The strange thing is that I get different (better) results when using the close of data2 instead of the normal close (of data1).

Below is some code to clarify what I mean:

 
Code
	
Condition7 = Close > Value2; // Profit Factor 1.53
 
Code
	
Condition7 = Close of Data2 > Value2; // Profit Factor 2
*Value2 being the value of the moving average

Shouldn't the results be the same? Is the 2nd code looking into the future?

Thanks for your help!


Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #5 (permalink)
Trading Apprentice
Zurich
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: $CL
 
Posts: 6 since Aug 2015
Thanks: 4 given, 1 received

Thanks for your answers @Jura and @ABCTG !

I thought that the Close of the daily bar would be the same as the 15M bar because (intrabar og turned off) they move in sync. I assumed that the script gets calculated on every tick and that Close referred to the current close of the bar (even if it's not closed yet).

So if I understand you guys right this is only true with intra bar order generation turned on? And otherwise the script is only calculated on every new bar hence the Close values will be different?

@ABCTG Thanks for the print suggestion, I should have tried that before! Also would you mind clarifying what you mean by "you can actually tie them to certain datastreams"

Thanks a lot for your help!

Reply With Quote
 
  #6 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

kristian,

you are welcome. You can find more information about variables and how to tie them to datastreams here in the Multicharts wiki.

When you tie a variable to a datastream you specify when it will be updated i.e. in line with this datastream. If you don't do that, the variable will updated whenever the Data1 variables are update.

Regards,

ABCTG


kristian View Post
Thanks for your answers @Jura and @ABCTG !

I thought that the Close of the daily bar would be the same as the 15M bar because (intrabar og turned off) they move in sync. I assumed that the script gets calculated on every tick and that Close referred to the current close of the bar (even if it's not closed yet).

So if I understand you guys right this is only true with intra bar order generation turned on? And otherwise the script is only calculated on every new bar hence the Close values will be different?

@ABCTG Thanks for the print suggestion, I should have tried that before! Also would you mind clarifying what you mean by "you can actually tie them to certain datastreams"

Thanks a lot for your help!


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

Reply



futures io > > > > > Moving Average of Data2

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
What are these moving average? Mopaditi NinjaTrader 3 September 24th, 2014 04:11 PM
Best Moving Average sharmas Elite Automated Trading 62 April 9th, 2012 07:44 PM
Moving Average Kush NinjaTrader Programming 5 November 6th, 2011 01:49 PM
Moving average Help yiman NinjaTrader Programming 4 July 29th, 2011 09:03 AM
New Moving Average arnaudlx The Elite Circle 10 January 28th, 2011 06:15 AM


All times are GMT -4. The time now is 03:24 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-18 in 0.11 seconds with 19 queries on phoenix via your IP 54.163.209.109