1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Fixed stock loss?

Discussion in 'Stock Trader Resolved Bug Reports' started by erich37, Jul 6, 2012.

  1. erich37

    erich37 Member

    not sure if this is a Yahoo bug or something, but my loss on the GEOX stock is over 2983%?

    geox.gif
     
  2. Sheldon

    Sheldon Active Member Sportsbook Pickem Survivor

    Well, considering you started at $1.86, and now each share is worth $0.06, not exactly sure.... Seems like with one share, it would be the same across the board.... I'm sure Bob will be able to provide more insight.
     
  3. Bob

    Bob Developer Staff Member

    na, its not a Yahoo Bug, its a Bob Bug LOL... I had a brain fart when I did the last step and used the wrong value..

    if you want to quick fix it on your own until I release the next version:

    /library/NFLJ/StockTrader/Model/Stock.php

    specifically line 368 (last line in the below block of code)

    Currently is this
    PHP:
                // Calculations
                
    $stock['totalcost'] = ($stock['shares_owned'] * $stock['purchase_price']);
                
    $stock['mktval']    = ($stock['shares_owned'] * $stock['lasttrade']);
                
    $stock['gain']        = ($stock['mktval'] - $stock['totalcost']);
                
    $stock['gainper']    = (($stock['gain'] / $stock[' mktval ']) * 100);
    Should be this!
    PHP:
                // Calculations
                
    $stock['totalcost'] = ($stock['shares_owned'] * $stock['purchase_price']);
                
    $stock['mktval']    = ($stock['shares_owned'] * $stock['lasttrade']);
                
    $stock['gain']        = ($stock['mktval'] - $stock['totalcost']);
                
    $stock['gainper']    = (($stock['gain'] / $stock['totalcost']) * 100);
     
    erich37 likes this.
  4. erich37

    erich37 Member

    I am glad it's just a bug on your end and I did not loose all my money on stock-trading ;) :lmao:
     
    Bob likes this.
  5. Bob

    Bob Developer Staff Member

    lol.. ya, glad it was an easy fix too. Can't believe I did that haha.. its tho only place I did it.. all the other places I did it correctly :oops:
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.