Click here to Login





                                                   Creating indicators


Previous - 0 1
QuantShare
2013-02-18 10:07:50

  0

"Ref" function does not refer to EOD data. It simply gets the previous value of an array. It works with EOD and Intraday data.

Regarding your indicator, if you see "1" values on a chart then you should get trades.
Let me know how it goes.



umair
2013-02-19 07:59:45

  0

The indicator that I've created is based on DAILY data. Instead of using HistoPrice, I have used REF. Therefore, when I add the indicator on my daily chart, it works great. It gives me the correct values.

Now what I am trying to do is use this indicator (based on daily values) on intraday backtesting. In other words, if this indicator was "1" at the end of trading day on MONDAY, I want to buy/sell at 9:30 the next morning.

There are two things I am confused about.

1) settings for the indicator= so when I created this indicator I had used TA.Ref(open,0) and TA.Ref(close,1) in the logic. The "open" and "close" variables were added using the parameter at the bottom:

open=number=open
close=number=close

Like, I said this works beauty when I added it to my chart (the values are correct). But what I don't understand is when I add this indicator on backtesting screen.. it looks like this:

indicatora(open,close)

The "open" and "close" values that show up..by default are they open=0 and close=1 (as I had it in my indicator)[above^]??

What happens if I change it to:
indicatora(0,10) ??

2) Second thing I'm confused about:

How can I implement a indicator that was created using REF (daily values) into a intraday trading strategy.

So lets assume I want to buy when indicatorA = 1 on daily chart when the time is 9:30AM:

interval settings- 1minute

rule1 = indicatora(open,close) > 0;
rule2 = (hour() == 9 and minute() == 30);
buy = rule1 and rule2

the above doesn't work.

I've also tried:
rule1 = indicatora(0,1) > 0; (my first problem described above)
rule2 = (hour() == 9 and minute() == 30);
buy = rule1 and rule2

this also does not work.

Please help! I'm spending way too much time on this lol
The most frustrating thing is that I have a screener and an indicator created for this logic, both work fine, but when I try to backtest it.. it doesnt work!



umair
2013-02-19 08:49:47

  0

Also any idea why this works in c#:
VectorD a = TA.Ref(open,0) < TA.Ref(close,1);
parameters:
open=open
close=close

but this does not work:
VectorD a = TA.HistoPrice(_open,0) < TA.HistoPrice(_close,1);
parameters:
_open=_open
_close=_close



umair
2013-02-19 10:35:01

  0

Ok I figured out my 2nd question: how to access daily calculations of a indicator during intraday backtesting:

rule1 = TimeframeDecompress(TimeframeApply(-1,indicatora(close,open))) > 0;

The above will access daily values for indicatora. When that indicator is 1.. the logic will buy/sell.

Please confirm.

Questions remaining:

Also any idea why this works in c#:
VectorD a = TA.Ref(open,0) < TA.Ref(close,1);
parameters:
open=open
close=close

but this does not work:
VectorD a = TA.HistoPrice(_open,0) < TA.HistoPrice(_close,1);
parameters:
_open=_open
_close=_close

Read more: http://www.quantshare.com/index.php?option=thread&tid=605&screen=1#ixzz2LIxSZZR6
Follow us: @quantshare on Twitter

AND

1) settings for the indicator= so when I created this indicator I had used TA.Ref(open,0) and TA.Ref(close,1) in the logic. The "open" and "close" variables were added using the parameter at the bottom:

open=number=open
close=number=close

Like, I said this works beauty when I added it to my chart (the values are correct). But what I don't understand is when I add this indicator on backtesting screen.. it looks like this:

indicatora(open,close)

The "open" and "close" values that show up..by default are they open=0 and close=1 (as I had it in my indicator)[above^]??

What happens if I change it to:
indicatora(0,10) ??

Read more: http://www.quantshare.com/index.php?option=thread&tid=605&screen=1#ixzz2LIxZCLmK
Follow us: @quantshare on Twitter


thx



QuantShare
2013-02-19 19:24:08

  0

The "Ref" and "HistoPrice" functions are totally different.

"Ref" references a previous bar. Not matter what time frame you are using.
"HistoPrice" is used with intraday data to reference previous DAILY bars (The daily bars are recreated internally from intraday data).

Regarding the second question, you should add parameters with different names. Try "open1" instead of the internal variable "open" that already exists.



No more messages
Previous - 0 1




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
Technical indicators time series
Crossover/Convergence of Several Trading indicators
Export Indicators Data with Filtering and Column Labels Support
Plot Economic Indicators on a Chart
Trading Rules using Trend Indicators

How-to Lessons
How to drag & drop indicators in charts
How to add a trading indicator to a chart
Difference between the watchlist and the screener tools
How to import trading items from other accounts
How to filter stocks in a market composite

Related Forum Threads
Peak / trough indicators and issue with Functions
Making available indicators read-only
How to trade one symbol based on indicators of another?
Time cycle indicators
Correlation between indicators

Blog Posts
Composite Indicators
Correlation of market indicators
Learn How to Create Your Own Technical Analysis Indicators
How to Pick the Best Trend Indicators
3 Market Indicators based on Fundamental Data









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.