tried to reference too many bars back - TradeStation | futures io social day trading
futures io futures trading


tried to reference too many bars back
Updated: Views / Replies:635 / 4
Created: by malibu 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
 

tried to reference too many bars back

  #1 (permalink)
Elite Member
toronto canada
 
Futures Experience: Advanced
Platform: Matlab + NT + TS
Favorite Futures: FOREX
 
malibu's Avatar
 
Posts: 65 since Jul 2013
Thanks: 9 given, 17 received

tried to reference too many bars back

Hey folks,
For the life of me, I can NOT get the following strategy to place a trade. The code will verify, but when I open the strategy I get the error -tried to reference too many bars back- I then go to format strategy and change max bars back to 500... the strategy then runs but places no trades... please help.


inputs:
Price(Close),
small_trigger_period(20),
multiplier(4),
upcolor(Green),
downcolor(Red),
large_trigger_period(80);



Vars:
oLRSlope(0),ema(0), oLRAngle(0), oLRIntercept(0), oLRValueRaw(0),LowerBand( 0 );


Value1 = LinearReg (price, small_trigger_period, 0, oLRSlope, oLRAngle, oLRIntercept, oLRValueRaw);
Value2 = oLRValueRaw;
Value3 = XAverage(Value2,5);



Value11 = LinearReg (price, large_trigger_period, 0, oLRSlope, oLRAngle, oLRIntercept, oLRValueRaw);
Value12 = oLRValueRaw;
Value13 = XAverage(Value2,large_trigger_period/multiplier);



if {Value2>Value3} {and} Value12 crosses over Value13 then
{ CB > 1 check used to avoid spurious cross confirmation at CB = 1 }
Buy ( "BBandLE" ) next bar at market ;


{if Value1 crosses under Value2 and Value11 crosses under Value12 then
Sell ( "CustomLX" ) next bar at market ;
}

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

malibu,

it works fine for me. As you have blocked the short entries the strategy will only enter long, so you will only find one entry somewhere close to the beginning of the chart (max bars back setting plus a couple of bars).

Regards,
ABCTG


malibu View Post
Hey folks,
For the life of me, I can NOT get the following strategy to place a trade. The code will verify, but when I open the strategy I get the error -tried to reference too many bars back- I then go to format strategy and change max bars back to 500... the strategy then runs but places no trades... please help.


inputs:
Price(Close),
small_trigger_period(20),
multiplier(4),
upcolor(Green),
downcolor(Red),
large_trigger_period(80);



Vars:
oLRSlope(0),ema(0), oLRAngle(0), oLRIntercept(0), oLRValueRaw(0),LowerBand( 0 );


Value1 = LinearReg (price, small_trigger_period, 0, oLRSlope, oLRAngle, oLRIntercept, oLRValueRaw);
Value2 = oLRValueRaw;
Value3 = XAverage(Value2,5);



Value11 = LinearReg (price, large_trigger_period, 0, oLRSlope, oLRAngle, oLRIntercept, oLRValueRaw);
Value12 = oLRValueRaw;
Value13 = XAverage(Value2,large_trigger_period/multiplier);



if {Value2>Value3} {and} Value12 crosses over Value13 then
{ CB > 1 check used to avoid spurious cross confirmation at CB = 1 }
Buy ( "BBandLE" ) next bar at market ;


{if Value1 crosses under Value2 and Value11 crosses under Value12 then
Sell ( "CustomLX" ) next bar at market ;
}


Reply With Quote
 
  #3 (permalink)
Elite Member
toronto canada
 
Futures Experience: Advanced
Platform: Matlab + NT + TS
Favorite Futures: FOREX
 
malibu's Avatar
 
Posts: 65 since Jul 2013
Thanks: 9 given, 17 received



ABCTG View Post
malibu,

it works fine for me. As you have blocked the short entries the strategy will only enter long, so you will only find one entry somewhere close to the beginning of the chart (max bars back setting plus a couple of bars).

Regards,
ABCTG

Thank you so much! For some reason I am not understanding the max bars back deal or something because I can't get this thing to place a long trade at all... further assistance will be greatly appreciated.

Reply With Quote
 
  #4 (permalink)
Elite Member
toronto canada
 
Futures Experience: Advanced
Platform: Matlab + NT + TS
Favorite Futures: FOREX
 
malibu's Avatar
 
Posts: 65 since Jul 2013
Thanks: 9 given, 17 received

Will this strategy generate trades for you??

This one gives me the max bars back error, and again generates no trades... I'm missing something simple I think





inputs:
Price(Close),
small_trigger_period(20),
multiplier(4),
upcolor(Green),
downcolor(Red),
large_trigger_period(80);



Vars:
oLRSlope(0),ema(0), oLRAngle(0), oLRIntercept(0), oLRValueRaw(0),LowerBand( 0 );


Value1 = LinearReg (price, small_trigger_period, 0, oLRSlope, oLRAngle, oLRIntercept, oLRValueRaw);
Value2 = oLRValueRaw;
Value3 = XAverage(Value2,5);



Value11 = LinearReg (price, large_trigger_period, 0, oLRSlope, oLRAngle, oLRIntercept, oLRValueRaw);
Value12 = oLRValueRaw;
Value13 = XAverage(Value2,large_trigger_period/multiplier);



If Value2>Value3 AND Value12>Value13 then
Begin
Buy ( "Long" ) 100000 shares next bar at market ;
End;




If Value2<Value3 AND Value12 < Value13 then
Begin
Sellshort ( "Short" ) 100000 shares next bar at market ;
End;

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

The issue with max bars back is in fact quite simple once you got the hang out of it. You set how many bars you want be on the chart before the strategy can compute properly. It's a pain that you have to do it manually, but that's the way it is.
So when you have an average within your strategy that has a length of 80, you will have to set a Max Bars back value of at least 80. As an average with the length of 80 needs 80 bars to be calculated properly. Otherwise the strategy will trigger an error.

I suppose you didn't see any trades on your charts, because the Max Bars Back setting was very high and your amount of bars on the chart was very little (maybe even less than the Max Bars Back input). What interval and symbol did you use?

Regards,
ABCTG

Reply With Quote

Reply



futures io > > > > tried to reference too many bars back

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Magic Bean Bars for Sierra Chart (port of eman's momentum bars) vegasfoster The Elite Circle 20 August 9th, 2014 07:16 AM
External reference Sterlingtrader MultiCharts 1 May 2nd, 2014 05:50 AM
How to reference historical price bars by time billtf EasyLanguage Programming 4 February 25th, 2012 02:05 AM
FisherTransform - able to reference the bars that FisherTransform Indicator produces Zipper Ripper NinjaTrader Programming 5 July 9th, 2011 07:03 PM
Arrows Painting 2 bars back Saroj NinjaTrader 0 June 12th, 2009 04:12 PM


All times are GMT -4. The time now is 09:53 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-12 in 0.10 seconds with 19 queries on phoenix via your IP 54.221.93.187