Click here to Login





                                                   No. of bars in a different timeframe

  0

0
Obuli Govindaraju
2011-11-22 14:19:21


Lets say I am viewing the Chart in a monthly timeframe.

The Count() function returns the no. of bars in a monthly timeframe.

Now I would like to find out how many bars are there in a weekly timeframe.

I am trying this code and it returns the same results as monthly timeframe. What is wrong?

b = TimeframeApply(7,Count());
b = TimeframeDecompress(b);
output(b);



QuantShare
2011-11-24 03:01:01

  0

Best Answer
When referring a lower time frame, the data that is returned by "TimeframeApply" is already synchronized with the higher time frame.

You can get the number of bars using "Create Functions" editor:

result = cFunctions.GetTimeframeRawData(cFunctions.Symbol, 7, "close").Length;



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Stop Loss for the N-first Trading Bars only
Number of bars up to the end of the month
Convert Seconds to Trading Bars
Number of Consecutive Trading Bars Condition was True
Consecutive Up and Down Bars - Works With Any Trading Indicator

How-to Lessons
How to plot a stock using different periods in the same chart
How to plot two different time frames in the same chart
How to add future bars to plan for market scenarios
How to display the number of stocks per day for different RSI gro...
How to speed up watchlist and screener plug-ins when working with...

Related Forum Threads
change color of Ichimoku Cloud and plot the cloud in future 26 ba...
Timeframe Script
2 minute / 3 minute bars
different weights for different asset class
Different scales in the same pane

Blog Posts
Different periodicities and chart bar types in QuantShare Trading...
Same chart, different symbols
Different Types of Trading Indicators: Trend, Momentum, Volatilit...
Different Ticker Symbols for Each Data Source
Rules performance for different volatility regimes









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.