- unit = u = 50 # pixels per dollar - grid_size = 100 # dollars to each side of origin - strategy = @position.strategy .purses-gameui.padded = render '/iro/purses/header', purse: @position.purse .a - position = @position - stock = position.stock %h4= stock .header = position.quantity = stock = position.expires_on.to_datetime.strftime("%b %d") = link_to '[roll]', roll_position_path(position) = link_to '[~]', edit_position_path(position) - nearest_strike = stock.last.round .StockCoordinatesW .StockCoordinates .grid-mark.mark0 .label= nearest_strike - (1...grid_size).each_with_index do |idx| .grid-mark{ class: "mark#{idx}", style: "left: -#{idx * u}px" } .label = nearest_strike + idx .grid-mark{ class: "mark-#{idx}", style: "left: #{idx * u}px" } .label = nearest_strike - idx .Origin{ style: "left: #{ ( nearest_strike - stock.last )* u}px" } .label Last: = stock.last .PositionW{ style: "width: #{ position.begin_inner_price * u}px; left: #{ (stock.last - position.inner_strike - position.begin_inner_price) * u}px" } .Position - if position.net_amount >= 0 .Net.NetPositive{ style: "width: #{ (position.net_amount / 100) * u }px; right: 0" } .label net = pp_amount position.net_amount - else .Net.NetNegative{ style: "width: #{ (-1 * position.net_amount / 100) * u }px; left: 100%" } .label net = pp_amount position.net_amount .c - @positions.each do |position| .reviewing - stock = position.stock - nearest_strike = stock.last.round .StockCoordinatesW .StockCoordinates .grid-mark.mark0 .label= nearest_strike - (1...grid_size).each_with_index do |idx| .grid-mark{ class: "mark#{idx}", style: "left: -#{idx * u}px" } .label = nearest_strike + idx .grid-mark{ class: "mark-#{idx}", style: "left: #{idx * u}px" } .label = nearest_strike - idx .Origin{ style: "left: #{ ( nearest_strike - stock.last )* u}px" } .label Last: = stock.last - amnt = position.gain_loss_amount - border = amnt >= 0 ? "#{amnt * u}px solid green" : "#{amnt * -1 * u}px solid red" .PositionW{ style: "width: #{ position.begin_inner_price * u}px; left: #{ (stock.last - position.inner_strike - position.begin_inner_price) * u}px; border: #{border}; border-bottom-width: 2px" } .Position .c %br %br