NexusFi: Find Your Edge


Home Menu

 





Code for trading a part of the month?


Discussion in EasyLanguage Programming

Updated
    1. trending_up 8,393 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
Orjan
Stockholm Sweden
 
Posts: 20 since Apr 2012
Thanks Given: 12
Thanks Received: 2

I want one of my signals only to be traded the periods between day 1 and 5 and day 21 and day 31 every month. Not the other days. I guess I should use the reserved word "DayOfMonth" but I dont know how.

Does anyone have a clue?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577



Orjan View Post
I want one of my signals only to be traded the periods between day 1 and 5 and day 21 and day 31 every month. Not the other days. I guess I should use the reserved word "DayOfMonth" but dont no how.

Does anyone have a clue?

Untested - something like:

vars:
cantrade (false);

if DayOfMonth(date) >= 1 and DayOfMonth(date) <= 5 then cantrade = true;
if DayOfMonth(date) >= 21 and DayOfMonth(date) <= 31 then cantrade = true;

In MultiCharts, you can then do:

if cantrade = false then #return;

I am sure TradeStation has an equivalent, but I don't know what it is. Alternatively, just test for cantrade to be true before trading.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
Orjan
Stockholm Sweden
 
Posts: 20 since Apr 2012
Thanks Given: 12
Thanks Received: 2

Thanks, it works.

I also put in a false condition for the rest of the month, don't know if it is needed:

If DayOfMonth(date) >= 6 and DayOfMonth(date) <= 20 then cantrade = false;


Perhaps the "false" statement is enough? It makes an exception from the basic code that sas every day is Ok to trade.


Reply With Quote




Last Updated on April 14, 2012


© 2026 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 - Downloads - Top
no new posts