Re: [GNC] Stomped with interface between GNC (v4.18) and F::Q (v1.61_02)

2024-05-10 Thread Kalpesh Patel
That was it. Rounding down to 9 decimal places works. 

Thank you!

-Original Message-
From: John Ralls  
Sent: Wednesday, May 08, 2024 10:13 PM
To: Kalpesh Patel 
Cc: GnuCash User 
Subject: Re: [GNC] Stomped with interface between GNC (v4.18) and F::Q
(v1.61_02)

Kalpesh,

I think your price has too many digits. Try rounding it to 10E-9.

Regards,
John Ralls

> On May 8, 2024, at 09:05, Kalpesh Patel  wrote:
> 
> Hi GNC User community -
> 
> 
> 
> I am developing a second F::Q module of my own. The first one works 
> fine but second one seems to NOT want to work no matter what. I am in 
> middle of debugging it and it has stomped me why not so hoping someone 
> might be able to help me zero in where I am falling sort on the flow 
> for it. I am working with F::Q v1.61_02 and GNC v4.14 
> (4.14+(2023-03-25) build) running on Windows 11. (Note: I don't 
> believe any interface change has taken place in GNC v5.x that would cause
this but correct me here if I am wrong.).
> 
> 
> 
> Invoking GNC with debug shows that return value is #f, which means 
> something went wrong (run_executor is the "label" for my module and 
> other modules work fine from the debug output):
> 
> 
> 
> 11:19:24 DEBUG  handling-request: (currency INR USD)
> 
> * 11:19:24 DEBUG  results: ((INR (symbol . INR) (gnc:time-no-zone
.
> 2024-05-08 11:19:11) (last . 3/250) (currency . USD)))
> 
> * 11:20:38 DEBUG  ALPHAVANTAGE_API_KEY=NOTAREALAPIKEY
> 
> * 11:20:39 DEBUG  handling-request: (tsp C S L2030 I)
> 
> * 11:20:43 DEBUG  results: ((C (symbol . C) (gnc:time-no-zone .
> 2024-05-07 12:00:00) (last . 812423/1) (currency . USD)) (S 
> (symbol . S) (gnc:time-no-zone . 2024-05-07 12:00:00) (last . 4009/50) 
> (currency . USD))
> (L2030 (symbol . L2030) (gnc:time-no-zone . 2024-05-07 12:00:00) (last .
> 237163/5000) (currency . USD)) (I (symbol . I) (gnc:time-no-zone .
> 2024-05-07 12:00:00) (last . 42507/1000) (currency . USD)))
> 
> * 11:20:43 DEBUG  handling-request: (run_executor BK)
> 
> * 11:20:43 DEBUG  results: (#f)
> 
> * 11:20:43 DEBUG  handling-request: (yahoojson ^NYA)
> 
> * 11:20:44 DEBUG  results: ((^NYA (symbol . ^NYA) 
> (gnc:time-no-zone . 2024-05-08 12:00:00) (last . 2247813/125) 
> (currency . USD)))
> 
> 
> 
> Following is debug run from command line of gnc-fq-dump (which 
> provides all necessary fields for quote to be valid as it does not 
> show '** This stock quote cannot be used by GnuCash!' message):
> 
> 
> 
> C:\Users\kalpesh>perl "c:\Program Files (x86)\gnucash\bin\gnc-fq-dump" 
> -v run_executor BK
> 
> {snip}
> 
> ### [Wed May  8 11:34:40 2024]   %info : {
> 
> ###'BKISIN' => '-',
> 
> ###'BKcurrency' => 'USD',
> 
> ###'BKdate' => '05/08/2024',
> 
> ###'BKisodate' => '2024-05-08',
> 
> ###'BKmethod' => 'run_executor',
> 
> ###'BKprice' =>
'57.64500045776367',
> 
> ###'BKsuccess' => '1',
> 
> ###'BKsymbol' => 'BK',
> 
> ###'BKtimezone' => 'EDT'
> 
> ###  }
> 
> Finance::Quote fields Gnucash uses:
> 
>  symbol: BK   <=== required
> 
>date: 05/08/2024   <=== recommended
> 
> currency: USD  <=== required
> 
>last:  <=\
> 
> nav:  <=== one of these
> 
>   price: 57.64500045776367<=/
> 
> timezone: EDT  <=== optional
> 
> 
> 
> All fields returned by Finance::Quote for stock BK
> 
> 
> 
> stock   field  value
> 
> -   -  -
> 
> BK   ISIN: -
> 
> BK   currency: USD
> 
> BK   date: 05/08/2024
> 
> BKisodate: 2024-05-08
> 
> BK method: run_executor
> 
> BK  price: 57.64500045776367
> 
> BKsuccess: 1
> 
> BK symbol: BK
> 
> BK   timezone: EDT
> 
> 
> 
> 
> 
> C:\Users\kalpesh>
> 
> 
> 
> When running same command via YahooJSON following is the output which 
> works fine (I see that it does have more information returned back):
> 
> 
> 
> C:\Users\kalpesh>perl "c:\Program Files (x86)\gnucash\bin\gnc-fq-dump" 
> -v yahoojson BK
> 
> {snip}
> 
> Finance::Quote f

Re: [GNC] Stomped with interface between GNC (v4.18) and F::Q (v1.61_02)

2024-05-08 Thread John Ralls
Kalpesh,

I think your price has too many digits. Try rounding it to 10E-9.

Regards,
John Ralls

> On May 8, 2024, at 09:05, Kalpesh Patel  wrote:
> 
> Hi GNC User community -
> 
> 
> 
> I am developing a second F::Q module of my own. The first one works fine but
> second one seems to NOT want to work no matter what. I am in middle of
> debugging it and it has stomped me why not so hoping someone might be able
> to help me zero in where I am falling sort on the flow for it. I am working
> with F::Q v1.61_02 and GNC v4.14 (4.14+(2023-03-25) build) running on
> Windows 11. (Note: I don't believe any interface change has taken place in
> GNC v5.x that would cause this but correct me here if I am wrong.).
> 
> 
> 
> Invoking GNC with debug shows that return value is #f, which means something
> went wrong (run_executor is the "label" for my module and other modules work
> fine from the debug output):
> 
> 
> 
> 11:19:24 DEBUG  handling-request: (currency INR USD)
> 
> * 11:19:24 DEBUG  results: ((INR (symbol . INR) (gnc:time-no-zone .
> 2024-05-08 11:19:11) (last . 3/250) (currency . USD)))
> 
> * 11:20:38 DEBUG  ALPHAVANTAGE_API_KEY=NOTAREALAPIKEY
> 
> * 11:20:39 DEBUG  handling-request: (tsp C S L2030 I)
> 
> * 11:20:43 DEBUG  results: ((C (symbol . C) (gnc:time-no-zone .
> 2024-05-07 12:00:00) (last . 812423/1) (currency . USD)) (S (symbol . S)
> (gnc:time-no-zone . 2024-05-07 12:00:00) (last . 4009/50) (currency . USD))
> (L2030 (symbol . L2030) (gnc:time-no-zone . 2024-05-07 12:00:00) (last .
> 237163/5000) (currency . USD)) (I (symbol . I) (gnc:time-no-zone .
> 2024-05-07 12:00:00) (last . 42507/1000) (currency . USD)))
> 
> * 11:20:43 DEBUG  handling-request: (run_executor BK)
> 
> * 11:20:43 DEBUG  results: (#f)
> 
> * 11:20:43 DEBUG  handling-request: (yahoojson ^NYA)
> 
> * 11:20:44 DEBUG  results: ((^NYA (symbol . ^NYA) (gnc:time-no-zone
> . 2024-05-08 12:00:00) (last . 2247813/125) (currency . USD)))
> 
> 
> 
> Following is debug run from command line of gnc-fq-dump (which provides all
> necessary fields for quote to be valid as it does not show '** This stock
> quote cannot be used by GnuCash!' message):
> 
> 
> 
> C:\Users\kalpesh>perl "c:\Program Files (x86)\gnucash\bin\gnc-fq-dump" -v
> run_executor BK
> 
> {snip}
> 
> ### [Wed May  8 11:34:40 2024]   %info : {
> 
> ###'BKISIN' => '-',
> 
> ###'BKcurrency' => 'USD',
> 
> ###'BKdate' => '05/08/2024',
> 
> ###'BKisodate' => '2024-05-08',
> 
> ###'BKmethod' => 'run_executor',
> 
> ###'BKprice' => '57.64500045776367',
> 
> ###'BKsuccess' => '1',
> 
> ###'BKsymbol' => 'BK',
> 
> ###'BKtimezone' => 'EDT'
> 
> ###  }
> 
> Finance::Quote fields Gnucash uses:
> 
>  symbol: BK   <=== required
> 
>date: 05/08/2024   <=== recommended
> 
> currency: USD  <=== required
> 
>last:  <=\
> 
> nav:  <=== one of these
> 
>   price: 57.64500045776367<=/
> 
> timezone: EDT  <=== optional
> 
> 
> 
> All fields returned by Finance::Quote for stock BK
> 
> 
> 
> stock   field  value
> 
> -   -  -
> 
> BK   ISIN: -
> 
> BK   currency: USD
> 
> BK   date: 05/08/2024
> 
> BKisodate: 2024-05-08
> 
> BK method: run_executor
> 
> BK  price: 57.64500045776367
> 
> BKsuccess: 1
> 
> BK symbol: BK
> 
> BK   timezone: EDT
> 
> 
> 
> 
> 
> C:\Users\kalpesh>
> 
> 
> 
> When running same command via YahooJSON following is the output which works
> fine (I see that it does have more information returned back):
> 
> 
> 
> C:\Users\kalpesh>perl "c:\Program Files (x86)\gnucash\bin\gnc-fq-dump" -v
> yahoojson BK 
> 
> {snip}
> 
> Finance::Quote fields Gnucash uses:
> 
>  symbol: BK   <=== required
> 
>date: 05/08/2024   <=== recommended
> 
> currency: USD  <=== required
> 
>last: 57.605   <=\
> 
> nav:  <=== one of these
> 
>   price:  <=/
> 
> timezone:  <=== optional
> 
> 
> 
> All fields returned by Finance::Quote for stock BK
> 
> 
> 
> stock   field  value
> 
> -   -  -
> 
> BK  close: 57.4
> 
> BK   currency: USD
> 
> BK   date: 05/08/2024
> 
> BK  div_yield: 2.8397212
> 
> BKeps: 3.99
> 
> BK   exchange: NYSE
> 
> BK   high: 57.75
> 
> BKisodate: 2024-05-08
> 
> BK   last: 57.605
> 
> BK

[GNC] Stomped with interface between GNC (v4.18) and F::Q (v1.61_02)

2024-05-08 Thread Kalpesh Patel
Hi GNC User community -

 

I am developing a second F::Q module of my own. The first one works fine but
second one seems to NOT want to work no matter what. I am in middle of
debugging it and it has stomped me why not so hoping someone might be able
to help me zero in where I am falling sort on the flow for it. I am working
with F::Q v1.61_02 and GNC v4.14 (4.14+(2023-03-25) build) running on
Windows 11. (Note: I don't believe any interface change has taken place in
GNC v5.x that would cause this but correct me here if I am wrong.).

 

Invoking GNC with debug shows that return value is #f, which means something
went wrong (run_executor is the "label" for my module and other modules work
fine from the debug output):

 

11:19:24 DEBUG  handling-request: (currency INR USD)

* 11:19:24 DEBUG  results: ((INR (symbol . INR) (gnc:time-no-zone .
2024-05-08 11:19:11) (last . 3/250) (currency . USD)))

* 11:20:38 DEBUG  ALPHAVANTAGE_API_KEY=NOTAREALAPIKEY

* 11:20:39 DEBUG  handling-request: (tsp C S L2030 I)

* 11:20:43 DEBUG  results: ((C (symbol . C) (gnc:time-no-zone .
2024-05-07 12:00:00) (last . 812423/1) (currency . USD)) (S (symbol . S)
(gnc:time-no-zone . 2024-05-07 12:00:00) (last . 4009/50) (currency . USD))
(L2030 (symbol . L2030) (gnc:time-no-zone . 2024-05-07 12:00:00) (last .
237163/5000) (currency . USD)) (I (symbol . I) (gnc:time-no-zone .
2024-05-07 12:00:00) (last . 42507/1000) (currency . USD)))

* 11:20:43 DEBUG  handling-request: (run_executor BK)

* 11:20:43 DEBUG  results: (#f)

* 11:20:43 DEBUG  handling-request: (yahoojson ^NYA)

* 11:20:44 DEBUG  results: ((^NYA (symbol . ^NYA) (gnc:time-no-zone
. 2024-05-08 12:00:00) (last . 2247813/125) (currency . USD)))

 

Following is debug run from command line of gnc-fq-dump (which provides all
necessary fields for quote to be valid as it does not show '** This stock
quote cannot be used by GnuCash!' message):

 

C:\Users\kalpesh>perl "c:\Program Files (x86)\gnucash\bin\gnc-fq-dump" -v
run_executor BK

{snip}

### [Wed May  8 11:34:40 2024]   %info : {

###'BKISIN' => '-',

###'BKcurrency' => 'USD',

###'BKdate' => '05/08/2024',

###'BKisodate' => '2024-05-08',

###'BKmethod' => 'run_executor',

###'BKprice' => '57.64500045776367',

###'BKsuccess' => '1',

###'BKsymbol' => 'BK',

###'BKtimezone' => 'EDT'

###  }

Finance::Quote fields Gnucash uses:

symbol: BK   <=== required

  date: 05/08/2024   <=== recommended

  currency: USD  <=== required

  last:  <=\

   nav:  <=== one of these

 price: 57.64500045776367<=/

  timezone: EDT  <=== optional

 

All fields returned by Finance::Quote for stock BK

 

stock   field  value

-   -  -

BK   ISIN: -

BK   currency: USD

BK   date: 05/08/2024

BKisodate: 2024-05-08

BK method: run_executor

BK  price: 57.64500045776367

BKsuccess: 1

BK symbol: BK

BK   timezone: EDT

 

 

C:\Users\kalpesh>

 

When running same command via YahooJSON following is the output which works
fine (I see that it does have more information returned back):

 

C:\Users\kalpesh>perl "c:\Program Files (x86)\gnucash\bin\gnc-fq-dump" -v
yahoojson BK 

{snip}

Finance::Quote fields Gnucash uses:

symbol: BK   <=== required

  date: 05/08/2024   <=== recommended

  currency: USD  <=== required

  last: 57.605   <=\

   nav:  <=== one of these

 price:  <=/

  timezone:  <=== optional

 

All fields returned by Finance::Quote for stock BK

 

stock   field  value

-   -  -

BK  close: 57.4

BK   currency: USD

BK   date: 05/08/2024

BK  div_yield: 2.8397212

BKeps: 3.99

BK   exchange: NYSE

BK   high: 57.75

BKisodate: 2024-05-08

BK   last: 57.605

BKlow: 57.12

BK method: yahoo_json

BK   name: BK (The Bank of New York Mellon Cor)

BK   open: 57.23

BK pe: 14.437344

BKsuccess: 1

BK symbol: BK

BK   type: EQUITY

BK volume: 730814

BK year_range:39.65 - 58.28

 

 

C:\Users\kalpesh>

 

Given that, why would GNC not accept the pricing? Does it have to be in a
particular order what is returned back, or