Click here to Login





                                                   Pattern detection from AFL formula to QS

  0

0
Hmt Ptl
2013-02-04 12:39:20


Can anyone convert these two Amibroker AFLs into QuantShare formula?
They are for detecting cup & handle and head & shoulder patterns.

C&H:
http://www.amibroker.com/library/detail.php?id=306

H&S:
http://www.amibroker.com/library/detail.php?id=166



Hmt Ptl
2013-02-07 15:39:12

  0

OK, seems no one knows how to convert it to QS formula.

Anyways,
LLV(period) function gives only lowest value within given past period, how to get "Number of bars 'passed' since lowest value?"
Is there any inbuilt function for this in QS?

What is equivalent of following in QS taken from http://www.amibroker.com/library/detail.php?id=306 ? :
------------------------------------
URPV=DRPV=0;
i=EndValue(BLH); // What is equivalent to this function in QS?
j=EndValue(BBC);
do
{
// What is equivalent of "IIF" function in QS formula?
URPV = IIf(Ref(Close,i*-1)>Ref(Close,(i+1)*-1),Ref(Volume,(i*-1))*Ref(Close,(i*-1))-Ref(Close,(i+1)*-1),URPV);
DRPV = IIf(Ref(Close,i*-1)<Ref(Close,(i+1)*-1),Ref(Volume,(i*-1))*Ref(Close,(i+1)*-1)-Ref(Close,(i*-1)),DRPV);
i++;
} while (i<j); // How to loop like this in QS formula?
----------------------------
If QS doesn't already have any such equivalent function then kindly do post C# equivalent code.

Thanks.



Hmt Ptl
2013-02-11 16:07:53

  0

Why is this thread not getting any response? Quantshare you there?
Let me know if the information provided is not understandable or is incomplete or is not implementable!



QuantShare
2013-02-20 11:14:54

  0

To get the number of bars passed since lowest value, use "LlvLb" function.

Regarding the loop, you can type something like this:

do
{
xxxx
}
while(i < j);

// "i" and "j" variable must be numeric values (not vectors)

Inside the loop you must work with values (not entire vectors).

Example:
- Instead of "Ref(Close,i*-1)", type "Close[i]"
- Instead of "IIf", type
if([condition])
{
xxxx
}
else
{
xxxx
}




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
Simple pattern detection rules using close and open prices
High to low stock pattern for the close price
Price Pattern Drawing Tool
Combination Element from Lexicographical Index
Lagged Data From a Custom Database

How-to Lessons
How to hide a trading indicator from a particular time frame
How to create a formula
How to generate buy/sell signals from a trading system
How to run a screen or a watchlist from a script
How to import trading items from other accounts

Related Forum Threads
Calling a Function from another Function
Error in formula
Custom Multi-Dimensional Fitness Formula (CMDFF) for Optimizer
Portfolio - opening a chart from portfolio screen
Minium number of trades per year in fitness formula is not workin...

Blog Posts
How to Backtest a Strategy from a Chart
How to Send Commands to QuantShare from Excel or Other Applicatio...
Diversify your portfolio by investing in stocks from various indu...
How to filter quotes data from high and low price spikes
Working with the formula editor









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.