• #3250
      Hedgehog
      Basic

      Nice work on this one

    • #2685
      Hedgehog
      Basic

      Thank you again for this- enlightening. What is the ‘index’ referencing in your HS?

    • #2680
      Hedgehog
      Basic

      Thank you for sharing this, I’ve been tinkering with something similar to no avail. I keep breaching my maxPosi. I set it equal to the net of my two open positions (buys/sells). Was wondering how to tru-up to the exchange periodically to ensure that there is no position drift, would you have anything that can help with that => I found sync_positions but haven’t been able to get it working (that was about a month ago so am more proficient with the code.

      I am using one of firetron’s dca models and trying to stop when I reach a certain “maxPosi”. I’ve inserted the following in Exit() and Go() as described below. for some reason doesn’t seem that efficient.

      Bot Description:

      --    Firetron's Hedged DCA Dipper
      --
      --    Runs a long and a short each doing dollar cost averaging strategy.
      --    Expands positions on an interval and exits whenever there is a profit.
      --    Only expands a position when its profit is less than a trigger.

      Add’s

      
       netPos = (LongAmount() - ShortAmount())
        if netPos < 0 and Abs(netPos) > maxPosi then
          ExitCheckShort(debugInfo)
        elseif netPos > 0 and netPos > maxPosi then
          ExitCheckLong(debugInfo)
        else 
        end
      

      Code Blocks Updated

      --  ------------------------------------
      --    Exiting
      --  ------------------------------------
       
      function Exit ()
       
        local debugInfo = GetDebugInfo()
        netPos = (LongAmount() - ShortAmount())
        if netPos < 0 and Abs(netPos) > maxPosi then
          ExitCheckShort(debugInfo)
        elseif netPos > 0 and netPos > maxPosi then
          ExitCheckLong(debugInfo)
        else 
        end
      
        ExitCheckShort(debugInfo)
        ExitCheckShort(debugInfo)
       
      end
      

      Second Spot

       
      function Go ()
       
        local debugInfo = GetDebugInfo()
       
        if debugInfo.isVerbose then
          SafeLog(logHRule)
        end
        
         netPos = (LongAmount() - ShortAmount())
        if netPos < 0 and Abs(netPos) > maxPosi then
          ExitCheckShort(debugInfo)
        elseif netPos > 0 and netPos > maxPosi then
          ExitCheckLong(debugInfo)
        else 
        end
      
        GoCheckLong(debugInfo)
        GoCheckShort(debugInfo)
       
      end
      • This reply was modified 2 years, 5 months ago by Hedgehog.
      • This reply was modified 2 years, 5 months ago by Hedgehog.
      • This reply was modified 2 years, 5 months ago by Hedgehog.
      • This reply was modified 2 years, 5 months ago by Hedgehog.
    • #2649
      Hedgehog
      Basic

      This is really cool; How can this be used to launch backtest or simulations?

    • #2572
      Hedgehog
      Basic

      I cant seem to get this profit target working. When I out put logging there appear to be no market to market values

    • #2504
      Hedgehog
      Basic

      Hiya, anyone use FTX and this platform together? The site says it is supported but there is not much talk about it

Viewing 5 reply threads

Unlock your crypto trading potential

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

Join for Free