[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] How to convert a string to non-string characters?!



PureBytes Links

Trading Reference Links

Hope someone can help with this.  I had a programmer design a plugin DLL  that generates buying conditions based on certain algorithms.

The DLL creates a custom function in AmiBroker, ConditionGen( ) that spits back hundreds of different conditions in the form of strings, such as:


MA(C, 12) > C5 AND MA(C,20) < Close

So I am trying to use the function to dynamically set variables, but just realized that VarSet only works for numbers and VarSetText only sets string values. But how do I convert the string to characters that AmiBroker will recognize? In other words, I want AmiBroker to recognize "MA" as moving average, not just the letters 'M' and 'A'.


This is how I use the function in an optimization run, but it doesn't work because values returned by ConditionGen remain as dead strings, as far as AmiBroker can see:

Optimize  ("count", 1,1,500,1);
 
C5  = Ref(C, -5);  // ...etc: A number of variables set so that values returned by ConditionGen make sense

VarSetText( "Condition"+NumToStr(Count,1.0,0), ConditionGen(Count));

Buy = VarGetText( "Condition"+NumToStr(Count,1.0,0) );

Sell = etc...


Instead of setting Buy to the dynamic VarGetText, I imagine I first need to somehow convert that string to somehow strip away the string property and just leave alphanumeric values. How could that be achieved?

Any help much appreciated.




__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___