Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Yes, but that is the whole thing I am trying to avoid.
I want to buy in the middle of the GREEN candle in my pic. (Middle of the day in this case) Not at the close of the current green candle.
Not at the end of the day.
I understand that EasyLanguage can't calculate until AFTER the clsoe of the candle for its data calculations.
That's why I wondered if using multiples data sets (data1,data2,etc) was optimal in this situation.
Perhaps a data1 = close of 10min
data2 = high of daily[1]
if data1 > data2 then buy this bar at market on a very small interval chart, 1 tick ? 1 min?
Ok, that makes sense to me.
But how would you do that on a running basis for the chart?
[intrabarordergeneration = true];
If high of next bar > high[1] then buy next bar at market; or buy at market stop;
Does not work.
El errors out to :
Error 1; Description: 'Next Bar' can only be applied to 'OPEN', 'DATE' and 'TIME'
@bmtfken, what @kevinkdog is saying is all you need. It will work on a running basis. In real-time, if you place a stop order using the syntax "buy next bar at high stop;", then you will see a stop market order being placed at the high of the current bar as soon as the current bar closes and the next bar opens. Now if price makes it to that high, your order will be filled otherwise it wont. As an example, you can take a look at one of the canned strategies in TS called the Keltner Channel LE:
{ The IntrabarOrderGeneration attribute is set to false in this strategy because
strategy calculations depend on end-of-bar prices. Specifically, an "Average True
Range" is calculated. Calculation of Average True Range depends on end-of-bar high,
low, and closing prices. }
[IntrabarOrderGeneration = false]
inputs: Price( Close ), Length( 20 ), NumATRs( 1.5 ) ;
variables: Avg( 0 ), Shift( 0 ), UpperBand( 0 ), Setup( false ), CrossingHigh( 0 ) ;
Avg = AverageFC( Price, Length ) ;
Shift = NumATRs * AvgTrueRange( Length ) ;
UpperBand = Avg + Shift ;
if CurrentBar > 1 and Price crosses over UpperBand then
{ CB > 1 check used to avoid spurious cross confirmation at CB = 1 }
begin
SetUp = true ;
CrossingHigh = High ;
end
else if Setup and ( Price < Avg or High >= CrossingHigh + 1 point ) then
Setup = false ;
{ the High >= condition being true indicates that a buy must already have been
triggered at this bar so this setup has been used up and needs to be negated;
an example of a persisitent setup with an indefinite stop/limit trigger - setup
has to be negated after entry confirmed; also see Pivot Reversal LE/SE and
PercentR LE/SE }
if Setup then
Buy ( "KltChLE" ) next bar at CrossingHigh + 1 point stop ;
{ ** Copyright (c) 2001 - 2010 TradeStation Technologies, Inc. All rights reserved. **
** TradeStation reserves the right to modify or overwrite this strategy component
with each release. ** }
What happens if there is a gap? The next bar opens above the current high?
If you have the statement:
buy next bar at high stop;
Here's what I expect: If next bar opens above the previous high, the stop is triggered, and a market order should be immediately sent, filling it at opening price. That is how backtest engine should fill it. In reality, there will be slippage on the fill.