How to schedule an alert using intraday scale just once a day at a specific time
Author: DamV
Creation Date: 3/7/2017 7:16 PM
profile picture

DamV

#1
I need in the bars the current day information for example at 2PM.

When I used an intraday I can't execute it once a day (option not found).

Or maybe using a daily schedule it will put the last information if the current day in the last bar.
But in simulation it was not the case so I'm not sure.
profile picture

Eugene

#2
If I understand correctly, after deciphering your question, you miss a "Daily strategy scheduling" option for intraday in the Strategy Monitor. Place a condition in your code to trigger an alert only at a specific time using a one-liner function referenced in this FAQ:

FAQ | Strategies and WealthScript > "How do I code a rule for time of the day?"
profile picture

DamV

#3
Let me clarify my question.

My algo works well for simulation based on daily data but I need the current day and not the previous day for the real time usage.

At this time I found a simple way to have the correct information in simulation.

I run the algo in intraday during a trading day and scale the "minutes" Bars to daily Bars in my script.
In this case the last Bar contains the information of the current trading day (close of the last bar is the last price for example).

If I run the algo in daily scale, the current day is not added in the Bars in the simulation.
One question is maybe that I'm wrong and even if the simulation doesn't add the current day in the last bar maybe using the monitoring alert it works. Please clarify it.


I know it's possible to manage in the code a time via the link you posted above but it's not convenient.
For me it seems to a basic feature, so I'm wondering if there is a parameter somewhere to only execute/run automatically (to have an alert) the algo once a day but using x minutes scale.

Or maybe there is another way. Any suggestions are welcome.

profile picture

Eugene

#4
Not sure why you think you need today's incomplete bar at 2pm when said bar's High and Low can still change but one of this should help:

1. To get today's open shortly after, simply use GetSessionOpen: Fidelity Partial Bars

2. To execute the strategy near the close of the day (or at 2pm if you wish) to simulate an AtClose, simply use Yahoo! data with "Always return data with partial bar" option enabled. It's on the Data Manager's "Yahoo! Data" tab. This is the partial bar not available in the Fidelity data. With this checkbox enabled you can update your Yahoo! DataSets anytime during market session and get the current day's incomplete OHLC.
profile picture

DamV

#5
Partial values are not convenient for a loop. I was expected the data directly in Bars.
At this time I use the script in Intraday and converts the bars to daily. As a result the last bar contains the open of first bar of the current day and close of the last bar. So I need the same things with the ability to run it just once a day.
Using the DateTime is also not convenient because I want to control this settings from the Stragegy Monitoring.

CODE:
Please log in to see this code.



I was not able to add a bar with these partial values. Do you have a tip for that?

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

Eugene

#6
Disregard what you're trying to do. Just follow my advice #2. This is all you need. And, you have to work with Yahoo! data to make it work.