- unit = u = 50 # pixels per dollar - grid_size = 100 # dollars to each side of origin .purses-gameui.padded = render '/iro/purses/header', purse: @purse -# - @positions.map &:id - @positions.each_with_index do |position, idx| - stock = position.stock - if idx == 0 %h4= stock - else - prev_ = @positions[idx-1] - if stock != prev_.stock %hr %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 - # for Mu ( positions in one stock ) .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 -# .label -# BeginStrike: -# = position.inner_strike -# .label -# begin inner price: -# = position.begin_inner_price - 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 -# .label -# net: -# = pp_amount position.net_amount -# .BeginInnerPrice -# .label -# Begin Inner Price: -# = pp_amount position.begin_inner_price -# .marker.sprite-bottom.Breakeven{ style: "width: #{ (position.begin_inner_price) * u }px" } -# .half-circle -# .label.hide -# Breakeven: -# = position.inner_strike + position.begin_inner_price %br %br