Executing order on a real-time bar break - EasyLanguage Programming | futures io social day trading
futures io futures trading


Executing order on a real-time bar break
Updated: Views / Replies:646 / 8
Created: by timothymhanna Attachments:1

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
 

Executing order on a real-time bar break

  #1 (permalink)
Trading Apprentice
Detroit, MI
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 15 since Oct 2010
Thanks: 0 given, 3 received

Executing order on a real-time bar break

I'm using EasyLanguage in ApexTrader and have the following code example:

Inputs: StopAmt(20), ProfitAmt(50), TradeSize(2);
//Buy Order
[IntraBarOrderGeneration=True]
If High > High[1]
and Low > Low[1]
and Low[1] < Low[2]
and Low[2] < Low[3] then
Buy TradeSize Shares next bar at Market;
SetStopContract;
//Stop Loss
SetStopLoss(StopAmt);
//Profit Target
SetProfitTarget(ProfitAmt);

Is there any way to have a buy order execute once the current bar breaks the prior bar's high at the price of the prior bar's high? You can't do Buy this bar at Market.. And at close of this bar is not what I need. Is there maybe a way to say buy this bar at high of prior bar? Or maybe lagging the buy signal?

Thanks!

Tim

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
Singapore+Singapore
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 10 since Jun 2015
Thanks: 1 given, 0 received


have you tried:

buy this bar on close

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Detroit, MI
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 15 since Oct 2010
Thanks: 0 given, 3 received


teamaker View Post
have you tried:

buy this bar on close

Buy this bar on close would not work because if the trigger was the break of the prior bar high (entry signal) and "this bar" closes 20 points above the trigger/signal/break of prior bar high, the order does not reflect the actual execution methodology. Basically, I see that a lot of times when I tested this bar on close, the trade was missed and not recording how it should actually be trading.

The prior instructions would be buy this bar on break of prior bar high if signal condition is true.

Any thoughts?

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Singapore+Singapore
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 10 since Jun 2015
Thanks: 1 given, 0 received

"Buy this bar on close would not work because if the trigger was the break of the prior bar high (entry signal) and "this bar" closes 20 points above the trigger/signal/break of prior bar high"

In other automated trading system, CLOSE OF THIS BAR should representing the existing real time price. Every new tick from market will form the new CLOSE OF THIS BAR. as soon as it break your trigger, the program should take action to buy/sell.

If it is not working for TS. another work around is use another strategy running on high frequency chart, like 1M to take the instruction from master strategy and open the order on next bar - which will be on min later.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Detroit, MI
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 15 since Oct 2010
Thanks: 0 given, 3 received


teamaker View Post
"Buy this bar on close would not work because if the trigger was the break of the prior bar high (entry signal) and "this bar" closes 20 points above the trigger/signal/break of prior bar high"

In other automated trading system, CLOSE OF THIS BAR should representing the existing real time price. Every new tick from market will form the new CLOSE OF THIS BAR. as soon as it break your trigger, the program should take action to buy/sell.

If it is not working for TS. another work around is use another strategy running on high frequency chart, like 1M to take the instruction from master strategy and open the order on next bar - which will be on min later.

So just to confirm, "Close of this bar" when looking at a 1 hour chart, does not actually mean on the close of the 1 hour signal bar; it means on that bar but at the price on the break of the prior bar's high? My signals plot correctly, but the backtest plots at the actual close of the signal bar.

Reply With Quote
 
  #7 (permalink)
Elite Member
Los Angeles Ca USA
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES, ETF
 
Posts: 1 since Sep 2014
Thanks: 0 given, 0 received

BuyPrice = High[1];
Buy this bar at BuyPrice +1 ticks stop;


BuyPrice = High[1];
Buy this bar at BuyPrice +1 points stop;


BuyPrice = High[1];
Buy this bar at BuyPrice or higher;

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
Detroit, MI
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 15 since Oct 2010
Thanks: 0 given, 3 received


Arash View Post
BuyPrice = High[1];
Buy this bar at BuyPrice +1 ticks stop;


BuyPrice = High[1];
Buy this bar at BuyPrice +1 points stop;


BuyPrice = High[1];
Buy this bar at BuyPrice or higher;

ApexTrader (which uses tradestation programming) does not let me use exactly what you did above. I referenced the concept into the order though. Below is the code. Also, this chart includes the signals and the order executions from the backtest. I wrote notes on what it's doing and what it should be doing. Any idea how to make this work properly? Thanks!

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).



//FL1 Clean INSIDE bar signal with clean pre bars
if High > High[1]
and Low >= Low[1]
and Low[1] < Low[2]
and High[1] <= High[2]
and Low[2] >= Low[3]
and High[2] >= High[3]
then
Buy next bar at High[1] stop;
SetBreakEven(50);
if Low < Low[1]
then
Sell next bar at Low[1] stop;
SetStopLoss(100);

//FH1 Clean INSIDE bar signal with clean pre bars
if Low < Low[1]
and High <= High[1]
and High[1] > High[2]
and Low[1] >= Low[2]
and High[2] <= High[3]
and Low[2] <= Low[3]
then
SellShort next bar at Low[1] stop;
SetBreakEven(50);
if High > High[1]
then
BuyToCover this bar on close;
SetStopLoss(100);

Reply With Quote
 
  #9 (permalink)
Trading Apprentice
Singapore+Singapore
 
Futures Experience: Intermediate
Platform: TradeStation
Favorite Futures: ES
 
Posts: 10 since Jun 2015
Thanks: 1 given, 0 received

Please check help material of TS platform. please search:

Intrabar Order Generation.

The trader should enable that to allow trading strategy open order within a bar. there is also a setup for backtesting.

please have a try.

Reply With Quote

Reply



futures io > > > > > Executing order on a real-time bar break

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
Order fills on real time vs market replay calhawk01 NinjaTrader 4 November 16th, 2013 03:22 AM
Intra bar order @ pre determined time jay j EasyLanguage Programming 9 October 1st, 2013 08:40 PM
Executing trade while a bar has not closed yet? Amnesia Sierra Chart Programming 5 July 28th, 2013 06:05 PM
Time of Order Submission Limit Calculation / Conditional / Price Improvement Order CoopGeko IB Trader Workstation 0 September 17th, 2012 10:15 PM
Bar Counter For Line Break Bar Type Eagle01 NinjaTrader Programming 8 April 2nd, 2012 12:29 AM


All times are GMT -4. The time now is 12:38 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-14 in 0.11 seconds with 20 queries on phoenix via your IP 54.221.93.187