Basic 101 Strategy - futures io
futures io futures trading



Basic 101 Strategy


Discussion in EasyLanguage Programming

Updated by bchip
    1. trending_up 1,040 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 2 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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
 

Basic 101 Strategy

(login for full post details)
  #1 (permalink)
New York + NY
 
 
Posts: 1 since Jun 2020
Thanks: 0 given, 1 received

H All,

New to the community and new to programming on TradeStation. Building a simple strategy for practice. Creating an automated strategy to buy SPY on the 14th day of each month and sell on the 16th day (2 days after). I am having trouble building out the match for trading day.

For example if the entry or exit day falls on a non-trading day, how do I execute the last trading day before the non-trading day? My code so far:

//This is entry on the 14th of each month
If dayofmonth(date)=13 then buy ("Entry") next bar open;


//This is exit on the 16th of each month
If dayofmonth(date)=16 then Setexitonclose;

Thank you so much,
Kevin

Reply With Quote
The following user says Thank You to kwt4 for this post:

Can you help answer these questions
from other members on futures io?
Moving Trendline within day range
EasyLanguage Programming
StopLoss order canceled on every bar open
MultiCharts
What VPC configuration/specification do you use for TS?
TradeStation
With 1 click place orders on two accounts (rithmic and cqg)
NinjaTrader
Cumulative Bid/Ask Chart resets after 2Billion
MultiCharts
 
 
(login for full post details)
  #2 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,187 since Apr 2013
Thanks: 384 given, 1,422 received

kwt4,

you will likely need code that is able to detect holidays and weekends first. This would allow you to check at the beginning of every month if the 13th and 14th days are regular trading days and adjust the days accordingly if they are not.

Regards,

ABCTG


kwt4 View Post
H All,

New to the community and new to programming on TradeStation. Building a simple strategy for practice. Creating an automated strategy to buy SPY on the 14th day of each month and sell on the 16th day (2 days after). I am having trouble building out the match for trading day.

For example if the entry or exit day falls on a non-trading day, how do I execute the last trading day before the non-trading day? My code so far:

//This is entry on the 14th of each month
If dayofmonth(date)=13 then buy ("Entry") next bar open;


//This is exit on the 16th of each month
If dayofmonth(date)=16 then Setexitonclose;

Thank you so much,
Kevin


Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #3 (permalink)
Africa
 
Experience: Advanced
Platform: TradeStation
Trading: ES,YM,CL,GC
 
Posts: 70 since Sep 2017
Thanks: 91 given, 60 received



kwt4 View Post
H All,

New to the community and new to programming on TradeStation. Building a simple strategy for practice. Creating an automated strategy to buy SPY on the 14th day of each month and sell on the 16th day (2 days after). I am having trouble building out the match for trading day.

For example if the entry or exit day falls on a non-trading day, how do I execute the last trading day before the non-trading day? My code so far:

//This is entry on the 14th of each month
If dayofmonth(date)=13 then buy ("Entry") next bar open;


//This is exit on the 16th of each month
If dayofmonth(date)=16 then Setexitonclose;

Thank you so much,
Kevin


Rather use a > than sign, so if dayofmonth >= 16 then exit next bar.
This will help with one of the issues as you exit on the 1st day after that date.

But as ABCTG pointed out, logically you still need to answer the question, what happens if the 13th falls on a Sat/Sunday or Public holiday

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Basic 101 Strategy


June 14, 2020


Upcoming Webinars and Events
 

Introducing Edge Pools: Prop Pricing Model w/Edge Clear

Jul 9
 

Every journal equals ten meals for the hungry

Now
     



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