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

[amibroker] To detect if 'foreign' execution was successful or not



PureBytes Links

Trading Reference Links


Tomasz,
 
It works. Thanks.
 
Regards,
- Salil V Gangal
Tomasz Janeczko <amibroker@xxxxxx> wrote:





Hello,
Just follow up --- if you want to use if-else you have to convert ARRAY to just a number.There are many ways to do that. One of possibilities is using LastValue function:
f = Foreign("MSFT","C");
if( LastValue( IsNull( f ) ) )
{
result = "No such symbol";
}
else
{ 
result = "symbol exists";
}
result;
Best regards,Tomasz Janeczkoamibroker.com

----- Original Message ----- 
From: Tomasz Janeczko 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Wednesday, April 30, 2003 4:29 PM
Subject: Re: [amibroker] Re: How to detect if 'foreign' is successful or not ?

Salil,
 
The code has syntax error.
 
Foreign returns array. IsEmpty from ARRAY is also ARRAY.
You can not use ARRAYS in conjunction with if because it requires
single value (it has to decide YES or NO whenever one or other execution path
should be choosen - and ARRAY has multiple values)
 
BTW: you are using OLD version of the program because newer
one would give you appropriate ERROR MESSAGE in this case.
 
Best regards,Tomasz Janeczkoamibroker.com

----- Original Message ----- 
From: Salil V Gangal 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Wednesday, April 30, 2003 4:24 PM
Subject: RE: [amibroker] Re: How to detect if 'foreign' is successful or not ?


Chuck,
 
Nope ... this technique was not 'successful' when I tried.  Code I used in 'Guru' was ===>
 


x = IsEmpty(Foreign("MSFT","Close",fixup=1));
if (x) {
   message = "x is true";
}
else {
    message = "x is false";
}
message;
x = IsEmpty(Foreign("Non_existant_ticker","Close",fixup=1));
if (x) {
    message = "x is true";
}
else {
    message = "x is false";
}
message;
 
Regards,
- Salil V GangalSalil V Gangal <salil_gangal@xxxxxxxxx> wrote:

Chuck,
 
If you get a chance, try the example I gave in 'Guru'.  Use one of the tickers that exists in the database and one that does not.  Please let me know if this technique is 'successful' (!) or not.
 
Regards,
- Salil V GangalChuck Rademacher <chuck_rademacher@xxxxxxxxxx> wrote:


Why can't you just say:
 
x = IsEmpty(Foreign("Symbol","Close",fixup=1));
 
This should work if your Foreign instrument has no holes and the date range is the same or longer than the stock you are evaluating at the time.
 
Works for me... unless I don't understand the question.Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


Do you Yahoo!?The New Yahoo! Search - Faster. Easier. Bingo. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


Do you Yahoo!?The New Yahoo! Search - Faster. Easier. Bingo. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.






Yahoo! Groups Sponsor












Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.