Sha256: 3ebd282d177b308d0bf4fb40fe377dd379e7a0eb1a09b3c4922ecac45b13fdab

Contents?: true

Size: 1.58 KB

Versions: 2

Compression:

Stored size: 1.58 KB

Contents

- pos   = position
- stock = pos.stock
- nearest_strike = stock.last.round
- u = @unit # pixels per dollar

.collapse-expand.d-flex{ id: "gameui-pos-#{pos.id}" }
  [<>]
  .maxwidth= render "/iro/positions/header", pos: pos
.a
  = render "/iro/positions/header_#{pos.strategy.kind}", pos: pos
  .StockCoordinatesW
    .StockCoordinates{ style: "height: #{pos.purse.height}px " }
      = render "/iro/stocks/grid_#{pos.strategy.long_or_short}", stock: stock

      .Origin{ style: "left: #{ ( nearest_strike - stock.last )* u}px" }
        .label Last: #{pp_amount stock.last}
        .c

        -## Good, remove trash, leave as implemented.
        -# - left  = "#{ (stock.last - position.inner_strike - position.begin_inner_price) * u}px"
        -# - width = "#{ position.begin_inner_price * u}px"
        - left  = "#{ (stock.last - pos.inner_strike) * u}px"
        - width = "0px"
        .PositionW{ style: "left: #{left} ; width: #{width} " }
          .Position
            .PositionC

            - 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

            .Breakeven{ style: "width: #{ pos.begin_inner_price * u }px" }
              .label
                Breakeven:
                = pos.begin_inner_price

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iron_warbler-2.0.7.22 app/views/iro/positions/_gameui_covered_call.haml
iron_warbler-2.0.7.21 app/views/iro/positions/_gameui_covered_call.haml