Compare price by the trading day of month
Author: kyokushin
Creation Date: 11/17/2019 11:19 AM
profile picture

kyokushin

#1
How would I have to code this:

Sell everything if Nasdaq 100 closing is lower on trading day number 5 than opening was on trading day number 1 in January?
profile picture

Eugene

#2
Is "trading day number 5" also in January or in any given month (e.g. current)?
profile picture

Eugene

#3
CODE:
Please log in to see this code.
profile picture

kyokushin

#4
trading day number 5 is also in January
profile picture

Eugene

#5
And if condition is not met, should the system wait until next year?
profile picture

Eugene

#6
The code probably could be simplified even more depending on what "everything" means.
CODE:
Please log in to see this code.
profile picture

kyokushin

#7
If condition is not met system can buy stocks throughout the year under some conditions I created. If condition is met all stocks shall be sold on trading day 6 in January.
profile picture

Eugene

#8
So code in #6 should get the job done.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).