Sha256: fddf83e5255ca9c2a06a4c4a881bbd24ea73dde05b10646b4a91b3717ad08006

Contents?: true

Size: 1.38 KB

Versions: 18

Compression:

Stored size: 1.38 KB

Contents

- pos   = position
- stock = pos.stock
- nearest_strike = stock.last.round
- u = pos.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.q() *u}px " }
      .grid= render "/iro/stocks/grid_#{pos.strategy.long_or_short}", stock: stock, position: pos

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

        -## these are different
        - left  = "#{ ( stock.last - pos.outer.strike ) * u}px"
        - width = "#{ ( pos.outer.strike - pos.inner.strike ) * u}px"
        .PositionW{ class: pos.strategy.kind, style: "left: #{left}; width: #{width}; " }
          .Position
            .MaxGain{ style: "width: #{pos.max_gain * u}px" }
            .RollGuide

            - 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

18 entries across 18 versions & 1 rubygems

Version Path
iron_warbler-2.0.7.43 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.42 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.41 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.40 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.39 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.38 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.37 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.36 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.35 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.34 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.33 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.32 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.31 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.30 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.29 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.28 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.27 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
iron_warbler-2.0.7.26 app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash