I downloaded Community.Rules, but I am new and not sure how to use it. What I want is choosing different trading strategies based on one index. For example, for the index, if SMA(50)>SMA(200), then I apply trend following strategy for some specific trading object, or a stock. How can I do that? could you please show me one example? Thanks, Eugene.
Size:
Color:
Could you clarify what do you mean by "choosing/switching different strategies" in Rule wizard? Related question: can you give us an idea about the complexity of your "trend following strategy".
Size:
Color:
Take a simple example, If index SMA(50)>SMA(200) then use MACD as the entry and exit signal for the stockA, or symbolA. If index SMA(50)<SMA(200), then apply stochastic KD indicator for stockA, so that overbuy signal is selling signal and oversold is a buying signal.
Size:
Color:
Sounds like you can solve it by dragging and dropping two entry rules. One (the MACD rule) gets a MACD condition plus the "External Symbol Price is above its Moving Average" rule added by Community.Rules. The remaining entry rule gets two conditions: a Stochastic condition of your choice and "External Symbol Price is below its Moving Average". Voila.
Tutorial Video | Strategy | Use the Wizard to create a Rule-based Strategy
Size:
Color:
I fully understand what you mean but my concern is how do apply "'External Symbol Price is above its Moving Average' rule added by Community.Rules". Or simply say, how to reference the functions in Community.Rules? Do you have any example or I have to read the source code?
Many thanks. I am new here, I might bother you a lot later.
Size:
Color:
I got it, Eugene. Sorry to bother you. It is easy now. Thanks.
Size:
Color:
A new problem. I found the external symbol was fixed as the index of US Market, if I tried to got the external symbol from other dataset, how can I do?
Size:
Color:
Type your own symbol in the input field.
Size:
Color:
It is great. I found when the external symbol was input, it worked perfect no matter where this symbol located in the same or different dataset. But if there are two same symbols in the different datasets. How to specify which symbol is the one I want to use? Or, how to reference the external symbol in different datasets? thanks.
Size:
Color:
Using Rules-based code, it's not possible to differentiate. Wealth-Lab will look in the current DataSet first, and then search alphabetically through the DataSets.
In script code, you can specify the DataSet that an external symbol comes from. Just GetExternalSymbol in the QuickRef (F11).
Size:
Color: