Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 07-26-2011, 07:41 PM   #1

Predictor's Avatar

Join Date: Feb 2008
Location: Raleigh
Posts: 108
Ignore this user

Thanks: 5
Thanked 23 Times in 16 Posts

Reference Future Bar Data Tradestation

I'm trying to reference future bar data in one of my strategies to perform a testing (on purpose). tradestation throws an error. Any help in circumventing this is appreciated.

I'm just trying to build a theoretical perfect strategy to determine maximal profit potential in a market.
Predictor is offline  
Reply With Quote
Old 07-26-2011, 10:15 PM   #2

Tradewinds's Avatar

Join Date: Nov 2008
Location: Northeast U.S.
Posts: 891
Ignore this user

Thanks: 373
Thanked 231 Times in 164 Posts
Blog Entries: 6

Re: Reference Future Bar Data Tradestation

Quote:
Originally Posted by Predictor »
I'm trying to reference future bar data in one of my strategies to perform a testing (on purpose). tradestation throws an error. Any help in circumventing this is appreciated.

I'm just trying to build a theoretical perfect strategy to determine maximal profit potential in a market.
Instead of using a negative index to try to reference "future" data, you can delay the plot. You can set the plot backwards.

Code:
var: test(False);

test=high>High[1];

If test then begin
plot1[1](high, "test"); // Set to points and large weight
plot2(low, "test 2"); // Set to points and large weight
end;
__________________
Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens.
Tradewinds is offline  
Reply With Quote
Old 07-26-2011, 10:28 PM   #3

Predictor's Avatar

Join Date: Feb 2008
Location: Raleigh
Posts: 108
Ignore this user

Thanks: 5
Thanked 23 Times in 16 Posts

Re: Reference Future Bar Data Tradestation

I have a code now that will plot an indicator. However, i wanted to use the strategy reports to see what the optimal strategy would look like, i.e compute the metrics. Will that method work for a strategy?

Here is what I have. I'm getting a "floating point invalid" error though ..


Code:
If (Close[1] > Open[1] ) then 
begin
    Value1  =  Value1  + (close[1]-open[1] );
    Value2 = Value2 + 1;
End;

   
If isMax then 
	plot1( Value1,"MaxProfit"); 

If isMax = False  then 
	plot2(  Value1/Value2,"AvgProfit");
ah I fixed it..
Code:
If isMax = False and value2 > 0  then 
	plot2(  value1/value2,"AvgProfit");
So, you are saying I can delay the data and use that in a strategy? But when I say "buy on bar" will that use the delayed bar?

Last edited by Predictor; 07-26-2011 at 10:33 PM.
Predictor is offline  
Reply With Quote
Old 07-26-2011, 10:53 PM   #4

Tradewinds's Avatar

Join Date: Nov 2008
Location: Northeast U.S.
Posts: 891
Ignore this user

Thanks: 373
Thanked 231 Times in 164 Posts
Blog Entries: 6

Re: Reference Future Bar Data Tradestation

Quote:
Originally Posted by Predictor »
So, you are saying I can delay the data and use that in a strategy? But when I say "buy on bar" will that use the delayed bar?
I don't think you can delay the data, you can set a plot backwards "in time". I don't know if you can do that with a Buy or Sell in a strategy.
__________________
Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens.
Tradewinds is offline  
Reply With Quote
Old 07-26-2011, 10:57 PM   #5

Predictor's Avatar

Join Date: Feb 2008
Location: Raleigh
Posts: 108
Ignore this user

Thanks: 5
Thanked 23 Times in 16 Posts

Re: Reference Future Bar Data Tradestation

The word I'm getting on the street is that its not possible. I guess if you could export/import 2 data streams with the main lagged by 1 then it might be possible to do it in a strategy.

Quote:
Originally Posted by Tradewinds »
I don't think you can delay the data, you can set a plot backwards "in time". I don't know if you can do that with a Buy or Sell in a strategy.
Predictor is offline  
Reply With Quote
Old 07-26-2011, 11:57 PM   #6

Tradewinds's Avatar

Join Date: Nov 2008
Location: Northeast U.S.
Posts: 891
Ignore this user

Thanks: 373
Thanked 231 Times in 164 Posts
Blog Entries: 6

Re: Reference Future Bar Data Tradestation

Quote:
Originally Posted by Predictor »
The word I'm getting on the street is that its not possible. I guess if you could export/import 2 data streams with the main lagged by 1 then it might be possible to do it in a strategy.
Actually, now that you talk about data streams, I just had an idea.

Hi=high[3] of data2;

The question is, what data is the strategy using? If it's using the underlying data instead of data2 then I guess it wouldn't work.

I wonder if you could "print to file" the trades, and then process the stats in a spreadsheet. Or find a platform that can do what you want.
__________________
Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens.
Tradewinds is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Amibroker - Tick Data Backtesting Bar Reference Isahnshade Coding Forum 0 02-20-2011 11:13 PM
Which Company Has Fast, Reliable Data to Trade HK Future, Emini in Asia Countries? MoreYummy Futures Trading Laboratory 20 12-16-2009 03:04 PM
Future Data Error in TS Indicator blib Coding Forum 6 04-05-2009 04:09 PM
Pair Trading (future Vs Future at CME/Eurex) Accumulator Futures Trading Laboratory 0 03-11-2009 02:52 PM
What Is Your Reference Point? Soultrader Technical Analysis 0 12-08-2006 10:32 PM

All times are GMT -4. The time now is 10:52 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.