[Haasbot Utilities] Kobalt’s plunder: PlotExposure

1 75 Views 3 Comments 1 month ago
  • Don’t rememberz how I got this…
    “Great artists steal. They don’t do homages.”
    —=-Quentin Tarantino

    • This topic was modified 1 month ago by Kobalt.
    • This topic was modified 2 weeks, 1 day ago by Kobalt.
    HaasScript Code
    DefineCommand('PlotExposure', 'L-S exposure')
    local longAmount = LongAmount()
    local shortAmount = ShortAmount()
    
    -- Add a chart that shows the exposure
    local lineValue = IfElse(longAmount > 0, longAmount, -shortAmount)
    local line = Plot(2, 'Exposure', lineValue, {c=Green, s=Step})
    PlotDoubleColor(line, 0, Red, ChangeColorOpacity(Gray, 20))
    ChartSetOptions(2, 'Exposure')
    
    DefineOutput(VoidType)
    • #1629
      dena02
      Basic
      Up
      0
      Down

      Cool work

    • #1647
      Kobalt
      Basic
      Up
      0
      Down

      Thanks, easy share, knew many would find handy, more very soon, if you want to test, see something else, just DM me.

    • #1650
      Firetron
      Basic
      Up
      0
      Down

      Love it! Make it work for hedged!

Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free