if ($unpublished) { ?> <p class="unpublished"><?php print t('Unpublished'); ?> </p> <?php } ?> </header> <?php } ?> <?php // We hide the comments and links now so that we can render them later. array_debug(array_keys($content)); hide($content['comments']); hide($content['links']); print render($content); ?> <?php print render($content['links']); ?> <?php print render($content['comments']); ?> </article><!-- /.node -->
$claimPos = $bitfinexAPI->claim_positions($data); //close long position echo $newline . $claimPos['message'] . $newline; } } //stop loss if ($latestPrice < $ma_30) { //stop loss (short pos) is 2% above ATL $stopLow = $ATL + $ATL * 0.02; $output .= $newline . 'ATL: ' . number_format($ATL, 4) . ' | stop loss: ' . number_format($stopLow, 4) . ' | '; if ($latestPrice >= $stopLow) { $output .= ' stop loss exit'; if ($debug != 1 && $bitfinex_trading == 1) { $data['position_id'] = $position_id; $claimPos = $bitfinexAPI->claim_positions($data); echo $newline . $claimPos['message'] . $newline; } } else { $output .= ' no exit yet'; } $output .= $newline; } } } echo $output; echo 'active positions: '; if (is_array($active_pos)) { array_debug($active_pos); } else { echo 'None'; }
$output .= ' | long SL exit'; $newTrade = $bitfinexAPI->margin_short_pos($symbol, $latestPrice, $posAmt); } //stop loss } else { if ($positionID && $position['amount'] < 0) { //if short pos open if ($latestPrice >= $stopLow) { //downtrend stop loss //close short pos $action = $trade_signal = 'Buy'; $output .= ' | short SL exit'; $newTrade = $bitfinexAPI->margin_long_pos($symbol, $latestPrice, $posAmt); } //stop loss } } if ($newTrade['is_live'] == 1) { $last_action_data = array('last_action' => strtolower($action), 'last_price' => $latestPrice, 'trade_signal' => $trade_signal, 'currency' => $currency); $sendMailBody = $action . ' ' . $tradeAmt . ' ' . $currency . ' at ' . $latestPrice . ' (' . date('h:i A', time()) . ')'; $candleData->sendMail($sendMailBody); update_last_action($last_action_data); $output .= $newline . array_debug($newTrade) . $newline; } echo $output; echo $newline . $newline . 'Active Positions: '; if ($position['id']) { array_debug($activePos); } else { echo 'None'; }