TradeStation - How to place an order of GTC duration - futures io
futures io futures trading



TradeStation - How to place an order of GTC duration


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one veeyem with 2 posts (0 thanks)
    2. looks_two ktrader with 2 posts (2 thanks)
    3. looks_3 SammyD with 1 posts (0 thanks)
    4. looks_4 JimFeyn with 1 posts (0 thanks)
    1. trending_up 5,871 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

TradeStation - How to place an order of GTC duration

(login for full post details)
  #1 (permalink)
Singapore Singapore
 
Experience: Intermediate
Platform: TradeStation
Broker: TS
Trading: GOLD
 
Posts: 13 since Dec 2011
Thanks: 15 given, 1 received

I am trying to place an order thru a Strategy. The order submitted is defaulted to "DAY" duration. Which means it will get cancelled by end of the day. I am using range chart and hence each bar may span between days. I want to place the order with the duration GTC (Good to Cancel). Thx in advance.

Code used to place the order.
Buy "OrdName" 1 Contracts NEXT BAR AT High+0.01 Stop

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(167 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(116 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #2 (permalink)
glostrup, denmark
 
Experience: Advanced
Platform: Custom platform
Broker: CQG
Trading: Futures, Options, Stocks
 
ktrader's Avatar
 
Posts: 249 since Aug 2011
Thanks: 152 given, 275 received


veeyem View Post
I am trying to place an order thru a Strategy. The order submitted is defaulted to "DAY" duration. Which means it will get cancelled by end of the day. I am using range chart and hence each bar may span between days. I want to place the order with the duration GTC (Good to Cancel). Thx in advance.

Code used to place the order.
Buy "OrdName" 1 Contracts NEXT BAR AT High+0.01 Stop

You can use the OrderTicket object, i have included all properties you can set here

You only need to set the few you want to use.

Its the Duration field you want to change in your case, its a string containing the duration, like "DAY", "GTC", "GTC+", "30 min" etc. you can find the complete documentation in the easylanguage object reference.


 
Code
	var: tsdata.trading.OrderTicket OrderTicket1( NULL );

		OrderTicket1 = new tsdata.trading.OrderTicket;
		
		OrderTicket1.SymbolType = tsdata.common.SecurityType.stock;
		OrderTicket1.Quantity = 100;
		OrderTicket1.Action = tsdata.trading.OrderAction.Buy;
		OrderTicket1.Type = tsdata.trading.OrderType.market;
		OrderTicket1.Duration = "Day";
		OrderTicket1.LimitPrice = 0.0;
		OrderTicket1.LimitPriceStyle = tsdata.trading.PriceStyle.none;
		OrderTicket1.LimitPriceOffset = 0;
		OrderTicket1.StopPrice = 0.0;
		OrderTicket1.StopPriceStyle = tsdata.trading.PriceStyle.none;
		OrderTicket1.StopPriceOffset = 0;
		OrderTicket1.ActivationRules.UseActivationTime = false;
		OrderTicket1.ActivationRules.UseDeactivationTime = false;		
		OrderTicket1.TrailingStop = tsdata.trading.TrailingStopBehavior.off;
		OrderTicket1.TrailingStopAmount = 0.0;
		OrderTicket1.IfTouched = false;
		OrderTicket1.IfTouchedPrice = 0.0;
		OrderTicket1.IfTouchedPriceStyle = tsdata.trading.PriceStyle.none;
		OrderTicket1.IfTouchedPriceOffset = 0;
		OrderTicket1.ShowOnly = false;
		OrderTicket1.ShowOnlyQuantity = 0;
		OrderTicket1.ECNSweep = false;
		OrderTicket1.NonDisplay = false;
		OrderTicket1.Discretionary = false;
		OrderTicket1.DiscretionaryAmount = 0.0;
		OrderTicket1.BuyMinusSellPlus = false;
		OrderTicket1.Peg = tsdata.trading.PegBehavior.off;
		OrderTicket1.AllOrNone = false;
		OrderTicket1.ConvertInvalidStopToMarket = false;
		OrderTicket1.Name = "OrderTicket1";

Reply With Quote
The following 2 users say Thank You to ktrader for this post:
 
(login for full post details)
  #3 (permalink)
Singapore Singapore
 
Experience: Intermediate
Platform: TradeStation
Broker: TS
Trading: GOLD
 
Posts: 13 since Dec 2011
Thanks: 15 given, 1 received


Awesome. Thx for the quick response with the solution.

BTW, I had a chat with the TS technical helpdesk on this. They mentioned that the "DAY" order will be closed by end of the session. However, when the session starts again, the same "DAY" order will be placed again automatically. This will happen even though the RANGE bar is still in the midst of completing the range. I am now testing this in the SIM account. Will share the outcome here.

The code you shared gives great deal of flexibility when placing the order. Appreciated.

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
glostrup, denmark
 
Experience: Advanced
Platform: Custom platform
Broker: CQG
Trading: Futures, Options, Stocks
 
ktrader's Avatar
 
Posts: 249 since Aug 2011
Thanks: 152 given, 275 received


veeyem View Post
Awesome. Thx for the quick response with the solution.

BTW, I had a chat with the TS technical helpdesk on this. They mentioned that the "DAY" order will be closed by end of the session. However, when the session starts again, the same "DAY" order will be placed again automatically. This will happen even though the RANGE bar is still in the midst of completing the range. I am now testing this in the SIM account. Will share the outcome here.

The code you shared gives great deal of flexibility when placing the order. Appreciated.

Great you can use it..

I forgot to mention you have to call send() on the orderticket object to actually place the order - a minor but important detail

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Salt Lake City, Utah
 
Experience: Intermediate
Platform: NinjaTrader, Tradestation
Trading: Forex
 
Posts: 72 since Feb 2011
Thanks: 274 given, 36 received


veeyem View Post
Awesome. Thx for the quick response with the solution.

BTW, I had a chat with the TS technical helpdesk on this. They mentioned that the "DAY" order will be closed by end of the session. However, when the session starts again, the same "DAY" order will be placed again automatically. This will happen even though the RANGE bar is still in the midst of completing the range. I am now testing this in the SIM account. Will share the outcome here.

The code you shared gives great deal of flexibility when placing the order. Appreciated.

Let us know how that goes. In my experience, with Forex and TS, my stop order has been cancelled at 5pm EST since it is "day" only but when it goes to renew a few seconds later it responds with a "rejected" message (apparently this is due to some lag on the TS side settling for the day). Anyway, this can leave you in a tricky spot so beware. The problem will usually correct itself when the next bar on the Data1 stream closes, prompting the strategy to run again. This is not a big deal if Data1 is small such as 1m or 5m but can be a big deal if it's larger. You can write some object oriented checks as a safety mechanism but I won't go into that.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Athens, Greece
 
 
Posts: 3 since May 2013
Thanks: 2 given, 0 received

Dear all,

I have used tickets and still using them. Is there any other way to define order duration in Tradestation?

Also, does any of you sets order duration in FX using Tradestation? I don't get access to 1 min duration. Only IOC theoretically can cancel the order soon enough after its deployment.

Thank you

Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > TradeStation - How to place an order of GTC duration


Last Updated on September 9, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 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