Data2 for automated trading - EasyLanguage Programming | futures io social day trading
futures io futures trading


Data2 for automated trading
Updated: Views / Replies:4,475 / 10
Created: by Orjan 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
 

Data2 for automated trading

  #1 (permalink)
Trading Apprentice
Stockholm Sweden
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: Futures, forex
 
Posts: 20 since Apr 2012
Thanks: 12 given, 2 received

Data2 for automated trading

I the same Tradestation chart I have 1 minute (Data1) and 120 minute (Data2). I have put the strategy in Data1. One of my conditions is to buy when MACD of Data2 is below 0 and is rising. But when I test the strategy it neglects that condition (Condition1 in the code) and takes entries even when MACD is above 0. Greatful for input how to solve this. The strategy is verified.

My code:

Inputs: Price(Close of Data2),
Length1(12),
Length2(15);

Vars: ExpAv1(0),
ExpAv2(0),
MACD(0);

ExpAv1 = XAverage(Price, Length1) of Data2;
ExpAv2 = XAverage(Price, Length2) of Data2;

MACD = ExpAv1 - ExpAv2;

Condition1 = MACD < 0 AND MACD > MACD[1];
Condition2 = High of Data2 > High[1] of Data2;
Condition3 = High of Data1 > High[1] of Data1;

If Condition1 AND Condition2 AND Condition3 Then Buy This Bar;

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)
Trading Apprentice
San Francisco, California
 
Futures Experience: Advanced
Platform: NT, TS
Broker/Data: MBT
Favorite Futures: ES, EC, GC, CL
 
Posts: 28 since Mar 2010
Thanks: 1 given, 10 received


Hi,

I recommend you do the following:

1. Add Condition1(0), Condition2(0), Condition3(0) to Variables
2. Modify the "Conditions" part as follows:

Condition1 =0;
Condition2 =0;
Condition3 =0;

If (MACD < 0 AND MACD > MACD[1]) then Condition1=1;
If (High of Data2 > High[1] of Data2) then Condition2=1;
If (High of Data1 > High[1] of Data1) then Condition3=1;

If (Condition1=1 AND Condition2=1 AND Condition3=1) Then Buy This Bar;

Reply With Quote
The following user says Thank You to dtrade88 for this post:
 
  #4 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received

I don't think you can do this unless you insert a chart into another chart and the only way you can do that is if the charts are the same interval.

This is one of my chief complaints about TS's limitations for multi-time frame trading.

The current options are to use either Global Variables, Global Dictionary, or ADE.

I have a general sender/receiver for the global dictionary, but again, that has limitations as well, it won't backtest and depending on your applications, there are time stamp issues as TS only stamps data down to the 1 minute level.

If you want backtesting capability, then you'll have to go with ADE which makes the exercise beyond most moderate programming capabilities (you'd need a 3rd party code consultant).

If you can figure this out, I'd be very interested, but I've spoken with TS developers actually on the phone and they were supposed to be working on a temporary refinement of the GD sender and receiver to make it simpler to use.

I'm willing to bet that you're getting null values on your data2.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Stockholm Sweden
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: Futures, forex
 
Posts: 20 since Apr 2012
Thanks: 12 given, 2 received

dtrade88,

Thanks, but it did not solve the problem.

Reply With Quote
 
  #6 (permalink)
Trading for Fun
London
 
Futures Experience: None
Platform: mc, TS, ninja
Favorite Futures: es
 
Bimi's Avatar
 
Posts: 118 since Mar 2010
Thanks: 42 given, 58 received

use next bar instead of this bar


 
Code
buy next bar market;

Reply With Quote
 
  #7 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received

Disregard my post.....I was confusing time based charts with "advanced" charts. TS will not allow you to insert another chart for advanced types of different intervals.

For those of us who don't use time based charts, it's just another obstacle and limitation of range, renko, kase, kagi, tick charts, etc.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
 
  #8 (permalink)
Trading Apprentice
San Francisco, California
 
Futures Experience: Advanced
Platform: NT, TS
Broker/Data: MBT
Favorite Futures: ES, EC, GC, CL
 
Posts: 28 since Mar 2010
Thanks: 1 given, 10 received

Given that your Data1 is 1min and your Data2 is 120min and you want TS to take into account BOTH, you probably need to setup a time condition that would perform Condition1, Condition2, Condition3 calculations only at pre-determined times when BOTH, Data1 and Data2, are available.

Reply With Quote
 
  #9 (permalink)
Elite Member
Oslo,Norway
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: EUR/USD
 
ValutaTrader's Avatar
 
Posts: 66 since Apr 2011
Thanks: 4 given, 50 received


Orjan View Post
I

ExpAv1 = XAverage(Price, Length1) of Data2;
ExpAv2 = XAverage(Price, Length2) of Data2;

MACD = ExpAv1 - ExpAv2;

Řrjan,

Put the code above into a separate function MACD_calc and you may get a different result.
MACD=MACD_calc(Price, Length1, Length2) of Data2

Function
MACD_calc

input :
Price(numericseries),
Length1( numericsimple ),
Length1( numericsimple ) ;

variables: ExpAv1(0), ExpAv2(0);

ExpAv1 = XAverage(Price, Length1) ;;
ExpAv2 = XAverage(Price, Length2) ;

MACD_calc = ExpAv1 - ExpAv2;

Reply With Quote
The following 2 users say Thank You to ValutaTrader for this post:
 
  #10 (permalink)
Trading Apprentice
Stockholm Sweden
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: Futures, forex
 
Posts: 20 since Apr 2012
Thanks: 12 given, 2 received


Thank you ValutaTrader,

I have solved the problem.

Reply With Quote

Reply



futures io > > > > > Data2 for automated trading

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
Books on automated trading DarkPoolTrading Elite Automated Trading 5 August 24th, 2012 09:32 AM
Automated Trading Platforms trendtrader00 Platforms and Indicators 14 July 25th, 2012 04:05 PM
Automated trading on VPS edgefirst Traders Hideout 90 June 29th, 2012 02:12 PM
Automated Trading MMichael Emini Index Futures Trading 6 February 14th, 2012 01:32 PM
C++ Automated Trading dsraider Reviews of Brokers and Data Feeds 5 December 8th, 2011 10:28 AM


All times are GMT -4. The time now is 09:45 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-15 in 0.12 seconds with 19 queries on phoenix via your IP 54.91.171.137