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

[amibroker] Fwd: String manipulation function help requested-Can someone please check this code?


  • To: "Amibroker Yahoogroup" <amibroker@xxxxxxxxxxxxxxx>
  • Subject: [amibroker] Fwd: String manipulation function help requested-Can someone please check this code?
  • From: "Rakesh Sahgal" <rakeshsahgal@xxxxxxxxx>
  • Date: Sun, 7 Sep 2008 16:40:01 +0530

PureBytes Links

Trading Reference Links

STR_LEN_STK=StrLen(Name());
STR_LEN_STK=STR_LEN_STK-7;
MOD_SYMBL_STK=StrLeft(Name(),STR_LEN_STK);

STR_LEN_FUT=StrLen(Name());
STR_LEN_FUT=STR_LEN_FUT-6;
MOD_SYMBL_FUT=StrLeft(Name(),STR_LEN_FUT);
MOD_SYMBL_FUT=MOD_SYMBL_FUT+"_SSF";

STR_LEN_IDX=StrLen(Name());
STR_LEN_IDX=STR_LEN_IDX-4;
MOD_SYMBL_IDX=StrLeft(Name(),STR_LEN_IDX);
====================================================================================================
The above code works as I wanted it to.

I will be very grateful if some can please check the following code and point out the mistakes in it
====================================================================================================
MOD_SYMBL=
if(GroupID()==1)    
{
MOD_SYMBL==MOD_SYMBL_STK
}
else if    (GroupID()==2)   
{
MOD_SYMBL==MOD_SYMBL_FUT)
}
else if    (GroupID()==3)
{
MOD_SYMBL==MOD_SYMBL_IDX
}
;

---------- Forwarded message ----------
From: Rakesh Sahgal <rakeshsahgal@xxxxxxxxx>
Date: Sun, Sep 7, 2008 at 12:09 PM
Subject: String manipulation function help requested
To: Amibroker Yahoogroup <amibroker@xxxxxxxxxxxxxxx>


Hi All

I have 3 categories of symbols in my database [a] Stocks, [b] Futures and [c] Indexes categorised as per group.

Three different operations have to be performed on the database as part of a single scan , each operation is specific to each category of symbols. The ticker symbol of each issue has to be modified, the modification to be done dependent on the category of the symbol. The code for carrying out each modification was easy and this part of the problem I have been able to resolve.

My problem now is that I need to combine the 3 operation in a function such that all the 3 operations can be carried out in a single scan. A simpler method would be to write 3 scans and run each separately but that is not convenient since I wish to run the scan during trading hours. Given my lack of programming savvy I can only think of an "If else" kind of solution. This will however work on 2 categories if I am not mistaken. Is it possible to write a function which will run the operation specific to each category of symbols  on all the 3 categories as part of a single scan? If so I will be very grateful for any pointers in the right direction.

Thanks & Regards


R



__._,_.___

Please note that this group is for discussion between users only.

To get 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

__,_._,___