vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - Stock Trader for vBulletin (https://vborg.vbsupport.ru/showthread.php?t=135084)

keithsan 01-11-2007 02:20 AM

Quote:

Originally Posted by xxxsaint (Post 1155968)


exactly!

keithsan 01-11-2007 02:29 AM

could be my error in that i just turned on user reps for the board and jacked up the minimum balance. will check it out later..

Carl Anderson 01-11-2007 11:51 AM

One other option I would like to make this more realistic...

Have a setting on how long you must hold a stock before you can sell it!

A setting on how long after you sell a stock the money from the sell becomes available.

Without this my users are able to buy like say and Oil or Gold stock before the open when they see the market has been up overseas and then sell it and do the same thing the next morning.

On my real brokerage account I can't sell a stock I just bought that quick because it takes three days to clear and they don't like me selling what I don't really have yet..

So a setting on how long you must hold it would encourage investing instead of just buying anything. Plus you could set it for like 30 days and then people would need to pick their stocks more carefully because if the sell their money is not available for so many days to buy again...

darkilla2 01-12-2007 07:41 AM

Doesnt work It redirects me to my usercp?!

xxxsaint 01-12-2007 11:11 AM

Quote:

Originally Posted by darkilla2 (Post 1156841)
Doesnt work It redirects me to my usercp?!

Make your own link to point to vbtrade.php , someone's already asked about the template edit , we're still waiting on a response.

Lionel 01-12-2007 01:15 PM

Things got messed up after last update. It does not deduct points after purchase and does not add after selling.

zethon 01-12-2007 02:42 PM

Quote:

Originally Posted by xxxsaint (Post 1156948)
Make your own link to point to vbtrade.php , someone's already asked about the template edit , we're still waiting on a response.

You can edit whichever template you want to put the link in. Just make sure the link points to the vbtrade.php file on your server.

Quote:

Originally Posted by Lionel (Post 1157020)
Things got messed up after last update. It does not deduct points after purchase and does not add after selling.

I am not seeing this problem and so far you're the only one reporting it. If you want to send me a PM with the URL to your board, I can take a look and see if I can figure out what is wrong.

xxxsaint 01-12-2007 08:18 PM

Quote:

Originally Posted by zethon (Post 1157098)
You can edit whichever template you want to put the link in. Just make sure the link points to the vbtrade.php file on your server.


Cool , I was talking about this though :

Code:

(OPTIONAL)
* in AdminCP open the "navbar" template
* find:
        <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
* below it add:
        <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[ambst_title]</a></td>

Is there any way to get this mod to post your total portfolio value into your postbit ?

zethon 01-13-2007 03:53 AM

Quote:

Originally Posted by xxxsaint (Post 1157442)
Cool , I was talking about this though :

Code:

(OPTIONAL)
* in AdminCP open the "navbar" template
* find:
        <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
* below it add:
        <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[ambst_title]</a></td>

Is there any way to get this mod to post your total portfolio value into your postbit ?

Not right now.

zethon 01-14-2007 03:21 PM

By request, I have added a statistics page to this add-on,the ability to view other user's portfolios, and variables which can be added into the postbit. Upgrade as normal.

Lionel 01-14-2007 04:23 PM

At what point does it insert those values ambportval, ambportgainamt , ambportgainper in table user? Mine are empty even though there are traders.

Lionel 01-14-2007 04:59 PM

Few bugs. I found the cron, but:

1-one portfolio value is 147,300.700, it displays 130,135.20 in top portfolios
2-In table user I have many values as -9999999.999 in both ambportval and ambportgainamt
3-If you sell all your stocks, the new portfolio value is not updated and it still displays in top portfoloios.

I am not sure I understand the WHERE clause in the cron

Quote:

$symbols = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "stocktrader WHERE 1 GROUP BY symbol");

zethon 01-14-2007 07:00 PM

Quote:

Originally Posted by Lionel (Post 1159035)
Few bugs. I found the cron, but:

1-one portfolio value is 147,300.700, it displays 130,135.20 in top portfolios

I will look into this if someone else reports a problem. My test board and my main board, the figures are consistent, as they should be when the market is closed.

Quote:

Originally Posted by Lionel (Post 1159035)
2-In table user I have many values as -9999999.999 in both ambportval and ambportgainamt

Same as above. The default value for the field is 0.

Quote:

Originally Posted by Lionel (Post 1159035)
3-If you sell all your stocks, the new portfolio value is not updated and it still displays in top portfoloios.

This is how it's suppose to work. THe cron job updates "Top Portfolio's" everyday. So, you won't see any changes immediatly show up in the "Top Portfolios" page.

Quote:

Originally Posted by Lionel (Post 1159035)
I am not sure I understand the WHERE clause in the cron

Are you talking about the "WHERE 1"? What's there to understand?

zethon 01-14-2007 07:01 PM

Quote:

Originally Posted by Lionel (Post 1159004)
At what point does it insert those values ambportval, ambportgainamt , ambportgainper in table user? Mine are empty even though there are traders.

They are updated by the cron, which by default runs every night at midnight.

Lionel 01-14-2007 07:19 PM

some screenshots

1.-top portfolio
2.-value of same portfolio
3.-strange value in database

Quantnet 01-14-2007 07:43 PM

Quote:

Originally Posted by zethon (Post 1158953)
By request, I have added a statistics page to this add-on,the ability to view other user's portfolios, and variables which can be added into the postbit. Upgrade as normal.

How do you access the stat page ? How about postbit instruction ? Are these available yet?

d8tabyte 01-14-2007 07:47 PM

Hmm I uploaded all files, re-imported product and checked options.. when I go to top investors I get a 404.

Ive since upgraded to 3.6.4 and the standard mod works fine... any ideas?

http://digitalet.net/forum/vbtrade.php&do=topportfolios

zethon 01-14-2007 08:05 PM

Quote:

Originally Posted by d8tabyte (Post 1159239)
Hmm I uploaded all files, re-imported product and checked options.. when I go to top investors I get a 404.

Ive since upgraded to 3.6.4 and the standard mod works fine... any ideas?

http://digitalet.net/forum/vbtrade.php&do=topportfolios

Yes, this was a bad on my part. The proper link should be: vbtrade.php?do=topportfolios

zethon 01-14-2007 08:06 PM

Quote:

Originally Posted by Quantnet.org (Post 1159232)
How do you access the stat page ? How about postbit instruction ? Are these available yet?

I like to leave that up to the individual user. You can put the "postbit friendly variables" in postbit wherever you want. Same with the link to the stat page.

Quantnet 01-14-2007 08:15 PM

Can you give me instructions on how to display top 10 earners in Cyb - Advanced forum Stat mod ? Similar like top 10 posters....

I had Uncached templates: forumdisplay_sortarrow
when trying to reach vbtrade.php?do=topportfolios

zethon 01-14-2007 11:23 PM

Quote:

Originally Posted by Quantnet.org (Post 1159264)
Can you give me instructions on how to display top 10 earners in Cyb - Advanced forum Stat mod ? Similar like top 10 posters....

I had Uncached templates: forumdisplay_sortarrow
when trying to reach vbtrade.php?do=topportfolios

I am not familiar with that plugin or what you're trying to do. You may want to ask the author of that mod how to include my data into his stats. :-\

davidw 01-15-2007 12:00 AM

Quote:

Originally Posted by zethon (Post 1159258)
The proper link should be: vbtrade.php?do=topportfolios

This link, along with the link in the installation text file, both give me a database error
Code:

Database error in vBulletin 3.6.3:

Invalid SQL:
SELECT user.userid,user.username,user.ambportval, user.ambportgainamt, user.ambportgainper FROM vb_user WHERE (user.ambportval > 0) ORDER BY user.ambportgainamt desc LIMIT 20;;

MySQL Error  : Unknown column 'user.userid' in 'field list'
Error Number : 1054
Date        : Sunday, January 14th 2007 @ 07:44:55 PM
Script      : mywebsite /vbtrade.php?do=topportfolios
Referrer    :
IP Address  : nope
Username    : sorry
Classname    : vB_Database

I am using MySQL 5.0.20. Playing around with it and removing the user. in the field list and in the WHERE and ORDER BY temporarily issues a fix, but nothing is displayed for users.

Second, I just purchased stocks yet it shows a change - even though no change is displayed. Screenshot for clarification.

Third, just trivial, but why 3 digit decimal places?

xxxsaint 01-15-2007 01:27 AM

upgraded and running perfectly fine on 3.6.4!

Thanks so much , we all really appreciate your hard work :)


** Noticed though , that we now have commas in place on the amount of stock quantities owned. If you copy and paste your quantity into the " sell " box , it's not reading all of the digits past the 2nd comma, just a heads up , almost sold 7.2 million worth of stock for 7,200 :)

d8tabyte 01-15-2007 05:23 AM

Quote:

Originally Posted by christianb (Post 1159420)
This link, along with the link in the installation text file, both give me a database error
Code:

Database error in vBulletin 3.6.3:

Invalid SQL:
SELECT user.userid,user.username,user.ambportval, user.ambportgainamt, user.ambportgainper FROM vb_user WHERE (user.ambportval > 0) ORDER BY user.ambportgainamt desc LIMIT 20;;

MySQL Error  : Unknown column 'user.userid' in 'field list'
Error Number : 1054
Date        : Sunday, January 14th 2007 @ 07:44:55 PM
Script      : mywebsite /vbtrade.php?do=topportfolios
Referrer    :
IP Address  : nope
Username    : sorry
Classname    : vB_Database

I am using MySQL 5.0.20. Playing around with it and removing the user. in the field list and in the WHERE and ORDER BY temporarily issues a fix, but nothing is displayed for users.

Second, I just purchased stocks yet it shows a change - even though no change is displayed. Screenshot for clarification.

Third, just trivial, but why 3 digit decimal places?

Quote:

Database error in vBulletin 3.6.4:

Invalid SQL:
SELECT user.userid,user.username,user.ambportval, user.ambportgainamt, user.ambportgainper FROM vb3_user WHERE (user.ambportval > 0) ORDER BY user.ambportgainamt desc LIMIT 20;;

MySQL Error : Unknown table 'user' in field list
Error Number : 1109
Date : Monday, January 15th 2007 @ 01:20:50 AM
Script : http://digitalet.net/forum/vbtrade.php?do=topportfolios
Referrer : http://digitalet.net/forum/vbtrade.php?do=main
IP Address : ....
Username : ...
Classname : vb_database
Yup me too cept I am running PHP Version 4.4.4 and VB 3.6.4

Quantnet 01-15-2007 05:32 AM

no error here php 4.4.4 and vb 3.6.4

Quantnet 01-15-2007 06:00 AM

anyone has a working demo of this mod using reputation as cash ? Did anyone got this working in postbit ?

zethon 01-15-2007 05:06 PM

Quote:

Originally Posted by christianb (Post 1159420)
This link, along with the link in the installation text file, both give me a database error
Code:

Database error in vBulletin 3.6.3:

Invalid SQL:
SELECT user.userid,user.username,user.ambportval, user.ambportgainamt, user.ambportgainper FROM vb_user WHERE (user.ambportval > 0) ORDER BY user.ambportgainamt desc LIMIT 20;;

MySQL Error  : Unknown column 'user.userid' in 'field list'
Error Number : 1054
Date        : Sunday, January 14th 2007 @ 07:44:55 PM
Script      : mywebsite /vbtrade.php?do=topportfolios
Referrer    :
IP Address  : nope
Username    : sorry
Classname    : vB_Database

I am using MySQL 5.0.20. Playing around with it and removing the user. in the field list and in the WHERE and ORDER BY temporarily issues a fix, but nothing is displayed for users.

I wonder, are you using a table prefix? I will have to go through the code and make sure everything is set up properly to work with table prefixes.

Quote:

Originally Posted by christianb (Post 1159420)
Second, I just purchased stocks yet it shows a change - even though no change is displayed. Screenshot for clarification.

Yes, that is how it's suppose to work. That change is the market change based on the last trade. Take a look at: http://finance.yahoo.com/q?s=twx

Even though the market is closed today, it still shows a "change". What you want to pay attention to to se how much you've made is the "Gain" and "Gain %" fields.

Quote:

Originally Posted by christianb (Post 1159420)
Third, just trivial, but why 3 digit decimal places?

Some of my users trade "penny stocks" where one share might cost .045 cents. WIth only two decimal places, it was impossible to make a profit all these stocks, so I took the mod to 3 decimal places.

zethon 01-15-2007 05:07 PM

Quote:

Originally Posted by Quantnet.org (Post 1159611)
anyone has a working demo of this mod using reputation as cash ? Did anyone got this working in postbit ?

You can check out my board. I use reputation as the cash system and I also have the info working in postbit.

Quantnet 01-15-2007 06:15 PM

I sign up for your board to check out :)

I add this to my postbit_legacy

<span id="repdisplay_$post[postid]_$post[userid]">Portfolio :$post[ambportval] ($post[ambportgainper]%)</span></div>

This is how it shows Portfolio: 101505.000$ (0.039%) this should have been 3.9% but i notice you divide them to decimal.

I notice on your forum you have it shown as Porfolio: 9,323.75 rep
(+ 12%)

How do you add +/- in front of the percentage return. Also, can you add , in the thousand to make 100K become 100,000.000 as the way US uses.

Can we trim 000 after decimal point ? If those 3 decimals are all 0, why should we keep it.

Tulsa 01-15-2007 06:34 PM

When I load up the top portfolio screen, it's not populated at all. I get a nice header for members, portfolio value, total earning and percentage but nothing else is listed.

Quantnet 01-15-2007 06:50 PM

Anyone got a better portfolio.gif ?
my portfolio.gif image is not shown properly. It should have been /forum/images/misc/portfolio.gif but it points to /images/misc/portfolio.gif

To fix this, in vbtrade.php around line 496 change <img src='/images/misc/portfolio.gif' to <img src='images/misc/portfolio.gif'

davidw 01-15-2007 07:09 PM

Quote:

Originally Posted by zethon (Post 1159972)
I wonder, are you using a table prefix? I will have to go through the code and make sure everything is set up properly to work with table prefixes.

Yes, that is how it's suppose to work. That change is the market change based on the last trade. Take a look at: http://finance.yahoo.com/q?s=twx

Even though the market is closed today, it still shows a "change". What you want to pay attention to to se how much you've made is the "Gain" and "Gain %" fields.

Some of my users trade "penny stocks" where one share might cost .045 cents. WIth only two decimal places, it was impossible to make a profit all these stocks, so I took the mod to 3 decimal places.

Yes, I am, which the hack does cover to an extent (the query does set up the table prefix to vb_ in the sql error).

zethon 01-15-2007 08:46 PM

Quote:

Originally Posted by Quantnet.org (Post 1160075)
Anyone got a better portfolio.gif ?
my portfolio.gif image is not shown properly. It should have been /forum/images/misc/portfolio.gif but it points to /images/misc/portfolio.gif

To fix this, in vbtrade.php around line 496 change <img src='/images/misc/portfolio.gif' to <img src='images/misc/portfolio.gif'

Damn leading slash, I will take care of that. Thanks!

Quote:

Originally Posted by christianb (Post 1160089)
Yes, I am, which the hack does cover to an extent (the query does set up the table prefix to vb_ in the sql error).

I've found a couple instances where the table prefix was missing. This will be fixed in an update I'm about to post. Let me know if this fixes your issue.

Quantnet 01-15-2007 09:06 PM

Thanks for the quick response, zethon

The latest version fixed the amount display problem. Now it displays 100,000.000 instead of 100000.000

Thanks

d8tabyte 01-16-2007 03:56 AM

Quote:

Originally Posted by d8tabyte (Post 1159603)
Yup me too cept I am running PHP Version 4.4.4 and VB 3.6.4

I am still recieving a DB error with that link.

HTML Code:

<td class="vbmenu_option"><a href="vbtrade.php?do=main">$vbphrase[ambst_title]</a></td>
</tr>
<tr>       
<td class="vbmenu_option"><a href="vbtrade.php?do=topportfolios">$vbphrase[ambst_topinv]</a></td>

My nav bar code ( I have it included in a drop down )

The page with error
http://digitalet.net/forum/vbtrade.php?do=topportfolios

I have downloaded the latest version, overwrote all and re-imported product with overwrite on.


Quote:

Database error in vBulletin 3.6.4:

Invalid SQL:
SELECT user.userid,user.username,user.ambportval, user.ambportgainamt, user.ambportgainper FROM vb3_user WHERE (user.ambportval > 0) ORDER BY user.ambportgainamt desc LIMIT 20;;

MySQL Error : Unknown table 'user' in field list
Error Number : 1109

Tulsa 01-16-2007 01:01 PM

Quote:

Originally Posted by Tulsa (Post 1160061)
When I load up the top portfolio screen, it's not populated at all. I get a nice header for members, portfolio value, total earning and percentage but nothing else is listed.


Well it's working now so I guess it needed to run it's cron job first before populating.

davidw 01-16-2007 02:25 PM

Quote:

Originally Posted by zethon (Post 1160152)
Damn leading slash, I will take care of that. Thanks!

I've found a couple instances where the table prefix was missing. This will be fixed in an update I'm about to post. Let me know if this fixes your issue.

This still doesn't work - everything else works fine - but the portfolio as before.

Quantnet 01-16-2007 05:13 PM

How often is the value in postbit updated ?
My topportfolion http://www.quantnet.org/forum/vbtrad...=topportfolios show different values than when you go to the portfolio value http://www.quantnet.org/forum/vbtrad...olio&userid=74

Magz 01-16-2007 06:40 PM

Quote:

Database error in vBulletin 3.6.4:

Invalid SQL:
SELECT user.userid,user.username,user.ambportval, user.ambportgainamt, user.ambportgainper FROM magical_user WHERE (user.ambportval > 0) ORDER BY user.ambportgainamt desc LIMIT 20;;

MySQL Error : Unknown table 'user' in field list
Error Number : 1109

I have had no other ussues while following this product, my users love it btw, but following all the updates, i still get the following error when trying to view the portfolios.

regards

Lionel 01-16-2007 06:46 PM

try adding "AS user"

FROM magical_user AS user


All times are GMT. The time now is 03:55 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01670 seconds
  • Memory Usage 1,869KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_html_printable
  • (31)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete