GTC stops instead of Day orders... free code for percent targets DAY help make GTC - EasyLanguage Programming | futures io social day trading
futures io futures trading


GTC stops instead of Day orders... free code for percent targets DAY help make GTC
Updated: Views / Replies:848 / 2
Created: by mslezak 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
 

GTC stops instead of Day orders... free code for percent targets DAY help make GTC

  #1 (permalink)
Trading Apprentice
Houston Texas
 
Futures Experience: Intermediate
Platform: OEC
Favorite Futures: SPX
 
Posts: 1 since Jul 2013
Thanks: 0 given, 0 received

GTC stops instead of Day orders... free code for percent targets DAY help make GTC

Anyone know how to modify this code I wrote that uses EasyLanguage to place DAY orders based on percent targets to code that places Good Until Cancelled orders? It seems the function written for stops in EL doesn't allow this parameter, so another function is required. Has to be a One Cancels Other order... Don't want to have to rely on an internet connection being up, just want the stops in place as soon as the initial position is triggered. Posting free code here in exchange for some help...


Inputs: Price(Close), //use the closing price for calcs
Cts(3), //#contracts for each trade
Notional(5000), //default per contract units (5000 bushels corn/ soybeans / wheat etc.)
StopLossPct(0.02), // 2% target, change to your liking
ProfitTgtPct(0.02); // 2% target

Vars:
PrcStopLessEntryPrice(StopLossPct*Cts*Notional), PrcPrfLessEntryPrice(ProfitTgtPct*Cts*Notional), StpLoss(0), PrfTgt(0);

// YOUR CODE HERE THAT DOES SOME BUY OR SELL BASED ON SOMETHING....
StpLoss = PrcStopLessEntryPrice * Price[0];
PrfTgt= PrcPrfLessEntryPrice * Price[0];

SetStopPosition;
SetStopLoss(StpLoss);
SetProfitTarget(PrfTgt);


Last edited by mslezak; August 6th, 2013 at 10:53 PM. Reason: Had to add OCO condition...
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)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,139 given, 4,387 received
Forum Reputation: Legendary



mslezak View Post
Anyone know how to modify this code I wrote that uses EasyLanguage to place DAY orders based on percent targets to code that places Good Until Cancelled orders? It seems the function written for stops in EL doesn't allow this parameter, so another function is required. Has to be a One Cancels Other order... Don't want to have to rely on an internet connection being up, just want the stops in place as soon as the initial position is triggered. Posting free code here in exchange for some help...


Inputs: Price(Close), //use the closing price for calcs
Cts(3), //#contracts for each trade
Notional(5000), //default per contract units (5000 bushels corn/ soybeans / wheat etc.)
StopLossPct(0.02), // 2% target, change to your liking
ProfitTgtPct(0.02); // 2% target

Vars:
PrcStopLessEntryPrice(StopLossPct*Cts*Notional), PrcPrfLessEntryPrice(ProfitTgtPct*Cts*Notional), StpLoss(0), PrfTgt(0);

// YOUR CODE HERE THAT DOES SOME BUY OR SELL BASED ON SOMETHING....
StpLoss = PrcStopLessEntryPrice * Price[0];
PrfTgt= PrcPrfLessEntryPrice * Price[0];

SetStopPosition;
SetStopLoss(StpLoss);
SetProfitTarget(PrfTgt);


I'm almost positive that you cannot create GTC orders using automated code with SetStopLoss, SetProfitTarget. They are just day orders for that bar, unless the next bar cancels them or reaffirms them.

A couple of possible alternatives:

Use macros in your code to send the orders

Use PSP Order Ticket object (new programming in TS 9.0)


Unfortunately, I have no experience in either of the above.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote

Reply



futures io > > > > > GTC stops instead of Day orders... free code for percent targets DAY help make GTC

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
TradeStation - How to place an order of GTC duration veeyem TradeStation 5 September 9th, 2014 06:12 AM
How many ticks do you make a day? Dragon Traders Hideout 5 March 31st, 2014 04:50 PM
Automated entries, exits, stops and targets..Without a single line of code! Alex91320 NinjaTrader 0 August 14th, 2012 05:29 PM
Can Anyone Make a Living Day Trading? RIBOOWW2 Commodities Futures Trading 1 April 20th, 2011 04:09 PM


All times are GMT -4. The time now is 05:01 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-16 in 0.07 seconds with 19 queries on phoenix via your IP 54.163.210.170