What is wrong with my code? - futures io
futures io futures trading



What is wrong with my code?


Discussion in EasyLanguage Programming

Updated
    1. trending_up 785 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 6 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
 

What is wrong with my code?

(login for full post details)
  #1 (permalink)
Canicattė Italy
 
 
Posts: 15 since Nov 2018
Thanks: 0 given, 0 received

Hello everyone, i'm not very expert with Easylanguage. I don't understand what's wrong with this code by which to compare the date of tomorrow with that of a holiday.

Anyone have any suggestions?

Regards


 
Code
if  DayOfWeek(Date) = thursday  and (currentdate +1) =1180330   then
        nextBusinessDay = JulianToDate(DateToJulian(Date) + 4)

Reply With Quote

Can you help answer these questions
from other members on futures io?
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
Indicators for pair trading MES and M2K
Platforms and Indicators
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
If ES tracks SPX, why do support/resistance, Level 2, vo …
Emini and Emicro Index
Reading A set of Trading Signals
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
21 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


cactus1973,

what is the rational for using "currentdate" within this code?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #4 (permalink)
Canicattė Italy
 
 
Posts: 15 since Nov 2018
Thanks: 0 given, 0 received

what I would like to write with this code is: " if today is thursday and tomorrow's date is equal to 1180330 then nextbusinessday .... "

Reply With Quote
 
(login for full post details)
  #5 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

cactus1973,

currentdate is your computer's current date, it is not the date of the current bar. You can use Date instead and add days to it. However keep in mind that you are dealing with dates in EasyLanguage format.
Take a look at the built-in CalcDate function to find out how to add days to dates in EasyLanguage format.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #6 (permalink)
Canicattė Italy
 
 
Posts: 15 since Nov 2018
Thanks: 0 given, 0 received

ABCTG,

thank you for your suggestion, i've solved with the correction below :

 
Code
   if  DayOfWeek(Date) = thursday  and (CalcDate(date,1)) = 1180330  then
        nextBusinessDay = JulianToDate(DateToJulian(Date) + 4)
Regards

Reply With Quote
 
(login for full post details)
  #7 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

cactus1973,

you are welcome. I am glad to hear that you got it working.

Regards,

ABCTG


cactus1973 View Post
ABCTG,

thank you for your suggestion, i've solved with the correction below :

 
Code
   if  DayOfWeek(Date) = thursday  and (CalcDate(date,1)) = 1180330  then
        nextBusinessDay = JulianToDate(DateToJulian(Date) + 4)
Regards


Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > What is wrong with my code?


Last Updated on June 17, 2019


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

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

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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