public function __construct($tradeType = LONG_TRADE) { switch ($tradeType) { case LONG_TRADE: case REVERSAL_TRADE: case BREAKOUT_TRADE: $this->entryWatchDesc = "The entry price specifies the ideal purchase price of this stock."; $this->t1WatchDesc = "The First BioBounce Target. This is the first sell point should this stock drop past the entry price."; $this->entryDateDesc = "The date that this stock fell below the entry price."; $this->t1Desc = "The First BioBounce Target. Sell 25% of your holdings at this price."; $this->t2Desc = "The Second BioBounce Target. Sell 25% of your original holdings at this price."; $this->t3Desc = "The Third BioBounce Target. Sell 25% of your original holdings at this price."; $this->abandonDesc = "The end of day price limit. Sell the next day if this stock CLOSES below this price."; $this->entryHoldingDesc = "The price when this stock was purchased."; $this->hardStopDesc = "The hard stop price to sell all."; break; case SHORT_TRADE: case BREAKDOWN_TRADE: $this->entryWatchDesc = "The short price specifies the ideal price to short this stock."; $this->t1WatchDesc = "The First BioBounce Target. This is the first buy to cover point should this stock climb past the entry price."; $this->entryDateDesc = "The date that this stock climbed above the entry price."; $this->t1Desc = "The First BioBounce Target. Cover 33% of your holdings at this price."; $this->t2Desc = "The Second BioBounce Target. Cover 33% of your original holdings at this price."; $this->t3Desc = "The Third BioBounce Target. Buy to cover the rest of your original holdings at this price."; $this->abandonDesc = "The end of day price limit. Cover the next day if this stock CLOSES above this price."; $this->entryHoldingDesc = "The price when this stock was sold short."; $this->hardStopDesc = "The hard stop price to cover all."; break; case PULLBACK_TRADE: $this->entryWatchDesc = "The entry price specifies the ideal purchase price of this stock."; $this->t1WatchDesc = "The BioBounce Target. This is the sell point should this stock drop past the entry price."; $this->entryDateDesc = "The date that this stock fell below the entry price."; $this->t1Desc = "The BioBounce Target. Sell 100% of your holdings at this price."; $this->t2Desc = "NOT USED IN THIS KIND OF TRADE!"; $this->t3Desc = "NOT USED IN THIS KIND OF TRADE!"; $this->abandonDesc = "The end of day price limit. Sell the next day if this stock CLOSES below this price."; $this->entryHoldingDesc = "The price when this stock was purchased."; $this->hardStopDesc = "The hard stop price to sell all."; break; case BACKDRAFT_TRADE: $this->entryWatchDesc = "The short price specifies the ideal price to short this stock."; $this->t1WatchDesc = "The BioBounce Target. This is the buy to cover point should this stock climb past the entry price."; $this->entryDateDesc = "The date that this stock climbed above the entry price."; $this->t1Desc = "The BioBounce Target. Cover 100% of your holdings at this price."; $this->t2Desc = "NOT USED IN THIS KIND OF TRADE!"; $this->t3Desc = "NOT USED IN THIS KIND OF TRADE!"; $this->abandonDesc = "The end of day price limit. Cover the next day if this stock CLOSES above this price."; $this->entryHoldingDesc = "The price when this stock was sold short."; $this->hardStopDesc = "The hard stop price to cover all."; break; } $functionName = strtolower(GetTradeTypeConstantName($tradeType)) . "GetStrings"; $this->{$functionName}(); }
?> </a> </li> <?php if (strpos($uri, "short") !== FALSE) { ?> <li class='active shorts'> <?php } else { ?> <li> <?php } ?> <a href='lists.shorts.php'><?php echo GetTradeTypeConstantName(BACKDRAFT_TRADE); ?> </a> </li> </ul> <div class="account item"> <div class="helloName">Hello <?php echo $login->username; ?> </div> <div class="logoutDiv"> <a href="history.php" class="logout"> History </a> <span class="divider"></span> <a href="accountinfo.php" class="logout">
// Load all new tickers if ($watchlistItem->load()) { $lowOrEntry = $watchlistItem->get_variable('watchlist_low'); $highOrRange = $watchlistItem->get_variable('watchlist_high'); $top = $watchlistItem->get_variable('watchlist_top'); $bottom = $watchlistItem->get_variable('watchlist_bottom'); $t0 = $watchlistItem->get_variable('watchlist_target0'); $t1 = $watchlistItem->get_variable('watchlist_target1'); $t2 = $watchlistItem->get_variable('watchlist_target2'); $t3 = $watchlistItem->get_variable('watchlist_target3'); $tickerId = $watchlistItem->get_variable('watchlist_ticker_id'); $tip = $watchlistItem->get_variable('watchlist_tooltip'); $isZoned = $watchlistItem->get_variable('watchlist_is_zoned'); $ticker = new ticker(); $ticker->set_variable('ticker_id', $tickerId); $tradeTypeName = GetTradeTypeConstantName($tradeType); if ($ticker->load()) { $tickerSymbol = $ticker->get_variable('ticker_symbol'); } else { $tickerSymbol = "ERROR"; } } else { //header( 'Location: admin.editall.php' ) ; } $lowTitleName = $tradeType == BREAKOUT_TRADE || $tradeType == BREAKDOWN_TRADE ? "Entry" : "Low"; $highTitleName = $tradeType == BREAKOUT_TRADE || $tradeType == BREAKDOWN_TRADE ? "Range" : "High"; $topTitleName = $tradeType == BREAKOUT_TRADE || $tradeType == BREAKDOWN_TRADE ? "Hard Stop" : "Top"; $targetTitleName1 = $tradeType == PULLBACK_TRADE || $tradeType == BACKDRAFT_TRADE ? "Target" : "T1"; $targetTitleName3 = $tradeType == BREAKOUT_TRADE || $tradeType == BREAKDOWN_TRADE ? "Target" : "T3"; $t0ClassName = $tradeType == BREAKOUT_TRADE || $tradeType == BREAKDOWN_TRADE ? "" : "none"; $bottomClassName = $tradeType == BREAKOUT_TRADE || $tradeType == BREAKDOWN_TRADE ? "none" : "";
echo '</tr>' . "\n"; ?> </tbody> </table> <div class="editAll <?php echo GetTradeTypeConstantName($index); ?> "> <a href="admin.editwatchentries.php?tt=<?php echo $index; ?> " class="buttonLook editLink">EDIT ALL <?php echo GetTradeTypeConstantName($index); ?> </a> </div> </div> <?php } ?> </div> </div> <div class='emptyBottom'></div> <script src="js/navBar.js" type="text/javascript"></script> <script src="js/pageInit.js" type="text/javascript"></script> <script src="js/admin.js" type="text/javascript"></script> <script type="text/javascript">
function endOfDayEmail() { $email = new email(email::ADDRESSES_ALL_ACTIVE); $allText = array(BREAKOUT_TRADE => '', LONG_TRADE => '', PULLBACK_TRADE => '', SHORT_TRADE => '', BACKDRAFT_TRADE => '', BREAKDOWN_TRADE => ''); $transHistory = new transactions(); while ($transHistory->loadNext(' DATE(`transaction_date`) = DATE(NOW()) ')) { $hId = $transHistory->get_variable('transaction_holdings_id'); $holdings = new holdings(); $holdings->set_variable("holdings_id", $hId); if (!$holdings->load()) { continue; } $tId = $holdings->get_variable("holdings_ticker_id"); $ticker = new ticker(); $ticker->set_variable('ticker_id', $tId); if ($ticker->load()) { $symbol = $ticker->get_variable('ticker_symbol'); //echo "Adding to EOD EMAIL " . $symbol . "\n\n"; $tranDate = $transHistory->get_variable('transaction_date'); $tz = new DateTimeZone('America/New_York'); $date = new DateTime($tranDate); $date->setTimeZone($tz); $dateStr = $date->format("h:i A"); $tradeType = $transHistory->get_variable('transaction_tradetype'); $action = intval($transHistory->get_variable('transaction_action')); $actionPrice = floatval($transHistory->get_variable('transaction_price')); $actionInfo = email::GetEmailText($tradeType, $action, $symbol, $actionPrice, "", false); if (strlen($actionInfo["body"]) > 0) { $allText[$tradeType] .= "<div style=\"\" >" . $dateStr . " - " . $actionInfo["body"] . "</div>"; } } } $bodyText = ''; foreach ($allText as $key => $value) { if (strlen($value) > 0) { $bodyText .= "<div style=\"font-size:13pt;font-family:Helvetica;text-decoration:underline;text-align:center;padding-bottom:7px;padding-top:20px;font-weight:bold\">" . GetTradeTypeConstantName($key) . "</div>" . $value; } } if (strlen($bodyText) == 0) { echo "NO TRANSACTIONS TODAY " . $transHistory->debug(); $email->endOfDay("There were no BioBounce events today."); } else { echo "SENDING EOD EMAIL\n\n"; $email->endOfDay($bodyText); } }