Announcement

Collapse
No announcement yet.

Dynamic position sizing and opp code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic position sizing and opp code

    Hello

    Does anybody know how to access equity data via code.

    I am trying to read balance and unrealized gains in order to calculate my trading size but can't find a function that returns current balance and unrealized gains

    Please let me know if there is a way

    Thanks

  • #2
    Dynamic position sizing and opp code

    Hello

    I am trying to calculate my position sizing according to realized gains and loses but every code sample that I have found uses

    Strategy.DEFAULT

    and none calculates according to realized P/L. How can I read balance and unrealized in efs code please?

    I haven't been able to find information about object oriented programming or a work around a simple definition and properties, getters and setters

    Can I do that?

    Thanks

    Comment


    • #3
      Re: Dynamic position sizing and opp code

      felipecj
      There currently is no efs function that will return the equity of a strategy as the script is iterated through the chart.
      You will need to keep track of that yourself through the use of some variable(s) that you update with the profit/(loss) of each trade then based on that you can dynamically adjust the size that you want to apply to each subsequent trade in the strategy
      If you search the EFS Back Testing forum you may find some examples of code that will do that as I believe the topic has been discussed in the past
      Alex


      Originally posted by felipecj
      Hello

      I am trying to calculate my position sizing according to realized gains and loses but every code sample that I have found uses

      Strategy.DEFAULT

      and none calculates according to realized P/L. How can I read balance and unrealized in efs code please?

      I haven't been able to find information about object oriented programming or a work around a simple definition and properties, getters and setters

      Can I do that?

      Thanks

      Comment


      • #4
        Thanks for the answer. I appreciate it

        Comment

        Working...
        X