Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Alexander Lifanov
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Groups 0

    Alexander Lifanov

    @Alexander Lifanov

    0
    Reputation
    159
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Alexander Lifanov Unfollow Follow

    Latest posts made by Alexander Lifanov

    • RE: Limit order execution on high price on the next bar

      @ab_trader there is the code

      current = self.datas[0]
      
      limitprice = (1. + 2 * .005) * current.close[0]
      stopprice = (1. - .005) * current.close[0]
      
      self.log(f'\tBuy. Price: {current.close[0]:.8f}. Limit: {limitprice:.8f}. Stop: {stopprice:.8f}')
      self.buy_bracket(
       data=self.data,
       price=current.close[0],
       limitprice=limitprice,
       stopprice=stopprice
      )
      
      posted in General Code/Help
      A
      Alexander Lifanov
    • Limit order execution on high price on the next bar

      Hi
      I create order as buy_brackets and on the next bar the high price is higher than my limit price of order but it doesn't execute.

      2018-10-01T13:15:00, Open: 0.00003940. High: 0.00003965. Low: 0.00003918. Close: 0.00003920
      2018-10-01T13:15:00, 	Buy. Price: 0.00003920. Limit: 0.00003936. Stop: 0.00003904
      2018-10-01T13:20:00, Open: 0.00003933. High: 0.00003941. Low: 0.00003915. Close: 0.00003923
      2018-10-01T13:25:00, Open: 0.00003925. High: 0.00003927. Low: 0.00003910. Close: 0.00003911
      2018-10-01T13:30:00, Open: 0.00003910. High: 0.00003921. Low: 0.00003908. Close: 0.00003913
      2018-10-01T13:35:00, 	OPERATION PROFIT, GROSS -0.00000016, NET -0.00000016
      2018-10-01T13:35:00, Open: 0.00003911. High: 0.00003911. Low: 0.00003900. Close: 0.00003907
      
      

      Where have I mistake ?

      posted in General Code/Help
      A
      Alexander Lifanov