NexusFi: Find Your Edge


Home Menu

 





Possible to automatically place trades on the front contract?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one kevinkdog with 5 posts (2 thanks)
    2. looks_two timfel with 3 posts (0 thanks)
    3. looks_3 samuel3889 with 2 posts (0 thanks)
    4. looks_4 ABCTG with 1 posts (0 thanks)
    1. trending_up 1,300 views
    2. thumb_up 2 thanks given
    3. group 4 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

Possible to automatically place trades on the front contract?

  #1 (permalink)
samuel3889
New York, NY
 
Posts: 5 since Mar 2023
Thanks Given: 3
Thanks Received: 0

This is the first post on this forum (or any forum for that matter), so apologies if I'm not following standard forum etiquette.

I have coded a strategy to trade ES futures on the Daily timeframe through Tradestation. Part of the strategy uses a 200 day moving average, so it's not feasible to automate it on the current contract since its MA will never match the continuous contract's MA (since 200 days > 3 months). Is there any way to have a strategy run on @ES and for it to place trades on the active contract with no further input from me? Ideally, I would like to let the strategy run for a whole year without having to manually switch contracts every quarter.

If that's not possible, I know my other course of action would be to manually switch contracts every quarter. I would also have to use @ES as Data Stream 2 on the chart and just reference its MA in the strategy.

-Samuel

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
 
  #2 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360


samuel3889 View Post
This is the first post on this forum (or any forum for that matter), so apologies if I'm not following standard forum etiquette.

I have coded a strategy to trade ES futures on the Daily timeframe through Tradestation. Part of the strategy uses a 200 day moving average, so it's not feasible to automate it on the current contract since its MA will never match the continuous contract's MA (since 200 days > 3 months). Is there any way to have a strategy run on @ES and for it to place trades on the active contract with no further input from me? Ideally, I would like to let the strategy run for a whole year without having to manually switch contracts every quarter.

If that's not possible, I know my other course of action would be to manually switch contracts every quarter. I would also have to use @ES as Data Stream 2 on the chart and just reference its MA in the strategy.

-Samuel

just auto trade @ESM23 and when roll happens from June to Sept roll to @esu23 then to @ESZ23 etc.

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
samuel3889
New York, NY
 
Posts: 5 since Mar 2023
Thanks Given: 3
Thanks Received: 0



kevinkdog View Post
just auto trade @ESM23 and when roll happens from June to Sept roll to @esu23 then to @ESZ23 etc.

I didn't know that was possible, thank you!

That solves the two data streams problem, is there any solution/method to avoid manually rolling contracts every quarter?

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


samuel3889 View Post
I didn't know that was possible, thank you!

That solves the two data streams problem, is there any solution/method to avoid manually rolling contracts every quarter?

You could create an app that rolls for you.

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

samuel3889,

another idea could be using OrderTickets for trading (instead of a legacy strategy) and develop code that handles the rolling. This will become quite complex, though.

Regards,

ABCTG


samuel3889 View Post
I didn't know that was possible, thank you!

That solves the two data streams problem, is there any solution/method to avoid manually rolling contracts every quarter?


Follow me on Twitter Reply With Quote
  #6 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1


samuel3889 View Post
This is the first post on this forum (or any forum for that matter), so apologies if I'm not following standard forum etiquette.

I have coded a strategy to trade ES futures on the Daily timeframe through Tradestation. Part of the strategy uses a 200 day moving average, so it's not feasible to automate it on the current contract since its MA will never match the continuous contract's MA (since 200 days > 3 months). Is there any way to have a strategy run on @ES and for it to place trades on the active contract with no further input from me? Ideally, I would like to let the strategy run for a whole year without having to manually switch contracts every quarter.

If that's not possible, I know my other course of action would be to manually switch contracts every quarter. I would also have to use @ES as Data Stream 2 on the chart and just reference its MA in the strategy.

-Samuel

It will do this automatically — check the "Use this symbol for trading'checkbox:

"Use this symbol for trading - Check this setting to create a tradable symbol that includes the contract month and year along with coded rollover parameters to place orders on your custom continuous contract from the TradeStation Order Bar or via automated strategies. "

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


timfel View Post
It will do this automatically — check the "Use this symbol for trading'checkbox:

"Use this symbol for trading - Check this setting to create a tradable symbol that includes the contract month and year along with coded rollover parameters to place orders on your custom continuous contract from the TradeStation Order Bar or via automated strategies. "

Not sure what you mean by "it will do this automatically" - but just to be clear it certainly does not roll automatically for you.

Follow me on Twitter Reply With Quote
Thanked by:
  #8 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1


kevinkdog View Post
Not sure what you mean by "it will do this automatically" - but just to be clear it certainly does not roll automatically for you.

I was referring to the custom continuous contract which does roll automatically, according to the criteria you specify.

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


timfel View Post
I was referring to the custom continuous contract which does roll automatically, according to the criteria you specify.

Not exactly.

It rolls at the time according to the info you specify, but it is not automatic. You still have to manually change the symbol from something like @ESM23=11INC to @esu23=11INC, and you would have to manually enter and exit positions as appropriate.

Follow me on Twitter Reply With Quote
  #10 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1



kevinkdog View Post
Not exactly.

It rolls at the time according to the info you specify, but it is not automatic. You still have to manually change the symbol from something like @ESM23=11INC to @esu23=11INC, and you would have to manually enter and exit positions as appropriate.

Are you sure Kevin? From my reading of the documentation it seemed that it would change automatically, and that the symbol would change to indicate the month that was being traded. Maybe I’m wrong, but I’m pretty sure that’s what it says unless I misunderstood it.

Reply With Quote




Last Updated on June 13, 2023


© 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