Sha256: 2eb8eec746ddc8e68e8a5d848a2b221f7648f4293dcc8c23a8a36b92d9a276a6

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

- pos   = position
- stock = pos.stock
- nearest_strike = stock.last.round
- u = @purse.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

        - left  = "#{ ( pos.outer_strike - stock.last ) * u}px"
        - width = "#{ ( pos.inner_strike - pos.outer_strike ) * u}px"
        .PositionW{ style: "left: #{left}; width: #{width}; " }
          .Position
            .MaxGain{ style: "width: #{pos.max_gain * u}px" }

            - if pos.net_amount >= 0
              .Net.NetPositive{ style: "width: #{ (pos.net_amount / 100) * u }px; right: 0" }
                .label
                  net
                  = pp_amount pos.net_amount
            - else
              .Net.NetNegative{ style: "width: #{ (-1 * pos.net_amount / 100) * u }px; left: 100%" }
                .label
                  net
                  = pp_amount pos.net_amount
.c

Version data entries

2 entries across 2 versions & 1 rubygems

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