Currenttime / Now in a scan filter.

Smalltalk

New member
I cant find a function to return current system clock time (wallclock time).
I need it to provide realtime filtering of price changes.
Example:
1)Time now is 18:00 ET.
2)A small cap stock's last candle was just before close at 16:29 ET and it change price by 10% say from $1 to $1.10 at the time.
Then there were no trades so no candles.

I want to filter in stocks which are moving in the last minute.
At 18:00 ET time i run filter and do not want the 10% to be taken at the account as obviously i look for price cnahes NOW, not 1.5 h ago.

If i simply take close - close[1] on 1 Min time frame - then for the stock example i will get the 10% forever/all night.
So it will looks like it is moving all night.
I know that i can find time for close and close(1) but i need to KNOW Current time i.e. 18:00 ET.

What i found that GetTime() in the context of a filter DOES NOT RETUN WALLCLOCK TIME - always returns 16:29 in my example - i.e. time of last candle close???
The same happens with all other time functions i tried (in the context of a scan filter at least).
None of them seem to return me ET or UTC time NOW???

Confused:::
 
Solution
@Smalltalk If I'm interpreting your question correctly, you don't need a human readable time in order to determine if an equity has changed price in the last minute, you need to know if there is a difference between the current and previous 1m candles...

I'm with you on the fact that Time/Date calculations can be awkward at best... I avoid having to use them in my code at all cost, if possible... The amount of code required for most calculations requires multiple lines of code in order to extrapolate the desired results...

For your purpose it sounds as though simply using a time constraint for the calculation would resolve your issue... For example, testing for SecondsTillTime(1800) should suffice... Let us know if this...
@Smalltalk If I'm interpreting your question correctly, you don't need a human readable time in order to determine if an equity has changed price in the last minute, you need to know if there is a difference between the current and previous 1m candles...

I'm with you on the fact that Time/Date calculations can be awkward at best... I avoid having to use them in my code at all cost, if possible... The amount of code required for most calculations requires multiple lines of code in order to extrapolate the desired results...

For your purpose it sounds as though simply using a time constraint for the calculation would resolve your issue... For example, testing for SecondsTillTime(1800) should suffice... Let us know if this won't suffice and we can explore further...
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
423 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top