NexusFi: Find Your Edge


Home Menu

 





Entering with a limit order vs. market order


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one ABCTG with 4 posts (2 thanks)
    2. looks_two Donovan2580 with 4 posts (0 thanks)
    3. looks_3 kevinkdog with 2 posts (1 thanks)
    4. looks_4 djvie11 with 2 posts (0 thanks)
    1. trending_up 13,118 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 12 posts
    2. attach_file 3 attachments




 
Search this Thread

Entering with a limit order vs. market order

  #1 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

Hello everyone,

My current strategy is entering "At the market" at the proper time, and always at the open of the proper bar.

My question is this:

How can I generate a limit order at the price of the open of that same bar?

Here is the basic code I am currently using to generate the position.


If Condition3 and Condition2 Then begin Buy ("LE") next bar at Market;


Any help would be greatly appreciated.

I apologize if this is a silly question, but everything I have tried pushes me out to the following bar.

Thanks in advance,

Donovan

Attached Thumbnails
Click image for larger version

Name:	Futures_io.jpg
Views:	283
Size:	169.1 KB
ID:	239595  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
What broker to use for trading palladium futures
Commodities
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360



Donovan2580 View Post
Hello everyone,

My current strategy is entering "At the market" at the proper time, and always at the open of the proper bar.

My question is this:

How can I generate a limit order at the price of the open of that same bar?

Here is the basic code I am currently using to generate the position.


If Condition3 and Condition2 Then begin Buy ("LE") next bar at Market;


Any help would be greatly appreciated.

I apologize if this is a silly question, but everything I have tried pushes me out to the following bar.

Thanks in advance,

Donovan

I have never used this, so you'd want to test and verify:

Buy next bar at open next bar limit;

Follow me on Twitter Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Donovan2580,

another approach would be to use intrabar order generation and to issue the limit order once you have the open of the bar.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #5 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

I have tried:

Buy next bar at open next bar limit

And it works, but it pushes me out a bar. That is what I am trying to avoid.

Reply With Quote
  #6 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

ABCTG,

Two questions - how do I activate intrabar order generation & what code would I use to issue the limit order?

Thanks,

Donovan

Reply With Quote
  #7 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360


Donovan2580 View Post
I have tried:

Buy next bar at open next bar limit

And it works, but it pushes me out a bar. That is what I am trying to avoid.


I don't see what you are talking about, maybe I misunderstand. I tried both cases shown below, and they work as they should... the decision is marked with vertical line in both cases...




Follow me on Twitter Reply With Quote
Thanked by:
  #8 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Donovan2580,

this explains intrabar order generation reserved word, that you can set within the code:
IntraBarOrderGeneration (Reserved Word)

I would also suggest to read about the look inside bar backtesting feature of Tradestation to allow for a more accurate backtesting result, especially when it comes to intrabar order generation.

For orders "next bar" when intrabar order generation is active, means the next tick, so "Buy next bar at open limit; "
could work for you.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #9 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

I just wanted to say thanks for the help and suggestions.

I ended up resolving this issue with the following code:

Then begin Buy next bar (Close + .25) limit;

I probably had an odd situation because I am working on KASE bar charts so in the end, I was able to work off the close of the "Trigger bar"

Thanks again for everyone's help!

Donovan

Reply With Quote
  #10 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


Donovan2580,

you might want to take a look at this link showing some points to keep in mind when working on what TS calls "Advanced Bars" (like Kase), as you can easily fall into some pitfalls and create great looking backtests that will never hold up in real trading:
Advanced Chart Types - Strategy Back-testing & Automation

Regards,

ABCTG

Follow me on Twitter Reply With Quote




Last Updated on September 18, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts