Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

First independent community of traders

First independent community of traders Logo First independent community of traders Logo

First independent community of traders Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Questions/Q 3985
Next
In Process
hoz
hoz

hoz

  • 16 Questions
  • 22 Answers
  • 0 Best Answers
  • 32 Points
View Profile
  • 0
hoz
Asked: December 26, 20202020-12-26T14:03:18+00:00 2020-12-26T14:03:18+00:00In: Forex Expert Advisors

I would like to discuss the implementation of the money management system

  • 0

Hello. I had an idea yesterday. But yesterday I wanted to sleep and scored. Today I thought, and, although, I understand how to do it, but.. I don’t like the implementation I came up with. Therefore, I decided to write here to discuss this thing, if anyone is interested.

The essence is as follows: I, usually, did not use money management(MM), but, there was a desire to check how some variations will affect the profitability of systems. So the point is that there is a desire that when I add a class in which various MM systems will appear, I can choose, for example, enum directly from the bot’om the desired MM system. I.e. I start the bot, and chose, for example, system #1, and, bot-trades with this MM system. I chose system #2, and the bot trades with this MM system. Did anyone implement such a thread at all?

I lead this to the fact that any system can be conveniently run in one fell swoop across all MM systems at once (optimization by the MM field). It is clear that you can specify in the code which system to use, but.. as they say, laziness is the engine of progress)) Only here it’s not about laziness, but about paying more attention to writing code, and not monkey work, changing the same thing in each owl.

If anyone is interested, I can throw what I think today. And then discuss..

I haven’t seen such thoughts and approaches from anyone yet, so I decided to write about it and then start writing code. I just haven’t decided how to do it beautifully yet. And I don’t want to write anyhow. After all, this is written once, and you will have to use it constantly.

  • 10 10 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    10 Answers

    • Voted
    • Oldest
    • Recent
    1. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T14:04:41+00:00Added an answer on December 26, 2020 at 2:04 pm

      A100:
      Only those who write in the OOP style will understand you. Get used to it

      I totally agree.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. zloy_koldun

      zloy_koldun

      • 0 Questions
      • 3 Answers
      • 0 Best Answers
      • 26 Points
      View Profile
      zloy_koldun
      2020-12-26T14:04:32+00:00Added an answer on December 26, 2020 at 2:04 pm

      Viktar Dzemikhau:

      Like it’s nothing. It does.. You’re not paying attention. The shell calculates according to the input variables the minimum lot, which can be either percentage or fixed. Since this is only the minimum lot, it is not logical to display this calculation in a separate money management class, so I decided that this will be calculated in the intermediary class. You know what I mean?

      You’re the one who’s not paying attention. What does Your class do compared to a single function? Nothing!

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    3. a100

      a100

      • 0 Questions
      • 1 Answer
      • 0 Best Answers
      • 22 Points
      View Profile
      a100
      2020-12-26T14:04:27+00:00Added an answer on December 26, 2020 at 2:04 pm

      Viktar Dzemikhau:

      You know what I mean?

      Only those who write in the OOP style will understand you. Get used to it

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    4. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T14:03:54+00:00Added an answer on December 26, 2020 at 2:03 pm

      Vladimir Karputov:

      Anything is possible. Sample code: Expert Ichimoku

      Implemented the scheme:

      • the lot size is constant (the input parameter Lots is set to be greater than zero, and the input parameter Risk is set to zero)
      • the lot size is dynamic (the input parameter Lots is set to zero, and the input parameter Risk is set to greater than zero)

      Here, Risk is the percentage of risk per trade (the CMoneyFixedMargin class is used – trading with a fixed margin level).

      You can fasten the CMoneyFixedRisk class-trading with a fixed level of risk.

      You can compare the work of these two classes here: Money Fixed Margin and Money Fixed Risk. Here it is clearly shown how the Stop Loss affects the calculation of the position volume: what will happen if you specify a Stop Loss equal to zero and what will happen if you specify a Stop Loss not equal to zero.

      Vladimir, I don’t write like that. I don’t have procedural programming. If I write a method, it usually occurs 1 time in the entire hierarchy. You won’t find him anywhere else. There is no maximum overload. if there are different types (because there is no normal casting to the object in the MCL, this has to be done sometimes). Therefore, initially it is more difficult to think through the architecture sensitively than others. But this is not a barrier.

      In addition, I do not use standard libraries, because they are not convenient and cumbersome. In addition, there is no normal, in my opinion, system of naming variables and not only variables. And using something, you don’t learn to think. I’m used to writing everything myself. I trust only native tools of frameworks of known programming languages. Although, and there I found some shoals in early versions.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    5. artmedia70

      artmedia70

      • 1 Question
      • 41 Answers
      • 0 Best Answers
      • 102 Points
      View Profile
      artmedia70
      2020-12-26T14:03:49+00:00Added an answer on December 26, 2020 at 2:03 pm

      Viktar Dzemikhau:
      The Preface is great because I wanted to convey my idea. I see that I didn’t report it in its entirety. Everything You wrote I did. But it turned out that every time, before opening a position, you will need to create an object of the selected money management system and then get the received lot value from it. And I wanted to somehow implement it more flexibly, so that, as You wrote, you could choose the MM system from the external input parameter and in the parent class of all MM, an object of the class that is selected would be created and work with it throughout the program. I haven’t figured out how to do this. I stopped at this option, as You wrote. I did it myself after creating this branch

      .

      I thought I’d approach it differently. Nonpolymorphic here does not roll, because the parent class does not always include all the fields as the heir.

      Why create an object every time before opening a position? You create the object once in OnInit (), depending on the settings of external parameters. And you will be constantly selected one of the possible methods of calculating the lot. Changed the MM in the settings – changed the MM type in the MM class, and the program uses a different type of MM.

      It’s simple.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    6. barabashkakvn

      barabashkakvn

      • 7 Questions
      • 162 Answers
      • 0 Best Answers
      • 314 Points
      View Profile
      barabashkakvn
      2020-12-26T14:03:43+00:00Added an answer on December 26, 2020 at 2:03 pm

      Viktar Dzemikhau:

      ***

      Anything is possible. Sample code: Expert Ichimoku

      Implemented the scheme:

      • the lot size is constant (the input parameter Lots is set to be greater than zero, and the input parameter Risk is set to zero)
      • the lot size is dynamic (the input parameter Lots is set to zero, and the input parameter Risk is set to greater than zero)

      Here, Risk is the percentage of risk per trade (the CMoneyFixedMargin class is used – trading with a fixed margin level).

      You can fasten the CMoneyFixedRisk class-trading with a fixed level of risk.

      You can compare the work of these two classes here: Money Fixed Margin and Money Fixed Risk. Here it is clearly shown how the Stop Loss affects the calculation of the position volume: what will happen if you specify a Stop Loss equal to zero and what will happen if you specify a Stop Loss not equal to zero.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    7. ya_programmer

      ya_programmer

      • 0 Questions
      • 23 Answers
      • 0 Best Answers
      • 68 Points
      View Profile
      ya_programmer
      2020-12-26T14:03:37+00:00Added an answer on December 26, 2020 at 2:03 pm

      Viktar Dzemikhau:

      Hello. I had an idea yesterday. But yesterday I wanted to sleep and scored. Today I thought, and, although, I understand how to do it, but.. I don’t like the implementation I came up with. Therefore, I decided to write here to discuss this thing, if anyone is interested.

      The essence is as follows: I, usually, did not use money management(MM), but, there was a desire to check how some variations will affect the profitability of systems. So the point is that there is a desire that when I add a class in which various MM systems will appear, I can choose, for example, enum directly from the bot’om the desired MM system. I.e. I start the bot, and chose, for example, system #1, and, bot-trades with this MM system. I chose system #2, and the bot trades with this MM system. Did anyone implement such a thread at all?

      I lead this to the fact that any system can be conveniently run in one fell swoop across all MM systems at once (optimization by the MM field). It is clear that you can specify in the code which system to use, but.. as they say, laziness is the engine of progress)) Only here it’s not about laziness, but about paying more attention to writing code, and not monkey work, changing the same thing in each owl.

      If anyone is interested, I can throw what I think today. And then discuss..

      I haven’t seen such thoughts and approaches from anyone yet, so I decided to write about it and then start writing code. I just haven’t decided how to do it beautifully yet. And I don’t want to write anyhow. After all, this is written once, and you will have to use it constantly.

      A good idea.

      Waiting for implementation.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    8. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T14:03:32+00:00Added an answer on December 26, 2020 at 2:03 pm

      Artyom Trishkin:

      Och great Preface…

      Something like this:

      I. e.: create your own enumeration with descriptions, and then create an input parameter.

      In the example I gave, MM with a fixed lot will be selected by default.

      In the enumeration, you can add your desired enumeration values – I showed an example.

      The Preface is great because I wanted to convey my idea. I see that I didn’t report it in its entirety. Everything You wrote I did. But it turned out that every time, before opening a position, you will need to create an object of the selected money management system and then get the received lot value from it. And I wanted to somehow implement it more flexibly, so that, as You wrote, you could choose the MM system from the external input parameter and in the parent class of all MM, an object of the class that is selected would be created and work with it throughout the program. I haven’t figured out how to do this. I stopped at this option, as You wrote. I did it myself after creating this branch

      .

      I thought I’d approach it differently. Nonpolymorphic here does not roll, because the parent class does not always include all the fields as the heir.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    9. artmedia70

      artmedia70

      • 1 Question
      • 41 Answers
      • 0 Best Answers
      • 102 Points
      View Profile
      artmedia70
      2020-12-26T14:03:27+00:00Added an answer on December 26, 2020 at 2:03 pm

      Viktar Dzemikhau:

      Hello. I had an idea yesterday….

      …

      After all, this is written once, and you will have to use it constantly.

      Och great Preface…

      Something like this:

      //--- enums
      enum ENUM_MONEY_MANAGEMENT
        {
         MONEY_MANAGEMENT_FIX,               // Fixed volume
         MONEY_MANAGEMENT_MARTINGALE,        // Martingale
         MONEY_MANAGEMENT_DRUNK_TRADER,      // Drunk trader
         MONEY_MANAGEMENT_ENTIRE_CUTLET,     // Entire cutlet
         MONEY_MANAGEMENT_UNNECESSARY_MONEY, // Unnecessary money
         MONEY_MANAGEMENT_ETC                // etc ...
        };
      //--- input parameters
      input ENUM_MONEY_MANAGEMENT InpMoneyManagement   =  MONEY_MANAGEMENT_FIX;

      I. e.: create your own enumeration with descriptions, and then create an input parameter.

      In the example I gave, MM with a fixed lot will be selected by default.

      In the enumeration, you can add your desired enumeration values – I showed an example.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    10. vdev

      vdev

      • 1 Question
      • 42 Answers
      • 0 Best Answers
      • 100 Points
      View Profile
      vdev
      2020-12-26T14:03:23+00:00Added an answer on December 26, 2020 at 2:03 pm

      Viktar Dzemikhau:

      Hello. I had an idea yesterday. But yesterday I wanted to sleep and scored. Today I thought, and, although, I understand how to do it, but.. I don’t like the implementation I came up with. Therefore, I decided to write here to discuss this thing, if anyone is interested.

      The essence is as follows: I, usually, did not use money management(MM), but, there was a desire to check how some variations will affect the profitability of systems. So the point is that there is a desire that when I add a class in which various MM systems will appear, I can choose, for example, enum directly from the bot’om the desired MM system. I.e., I run the bot, and chose, for example, system #1, and, the bot-trades with this MM system. I chose system #2, and the bot trades with this MM system. Did anyone implement such a thread at all?

      I lead this to the fact that any system can be conveniently run in one fell swoop across all MM systems at once (optimization by the MM field). It is clear that you can specify in the code which system to use, but.. as they say, laziness is the engine of progress)) Only here it’s not about laziness, but about paying more attention to writing code, and not monkey work, changing the same thing in each owl.

      If anyone is interested, I can throw what I think today. And then discuss..

      I haven’t seen such thoughts and approaches from anyone yet, so I decided to write about it and then start writing code. I just haven’t decided how to do it beautifully yet. And I don’t want to write anyhow. After all, this is written once, and you will have to use it constantly.

      Everything could be described in two phrases.

      I want to set a parameter through enum.Has anyone ever done this?

      Answer: Yes

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    Stats

    • Questions 504
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 676
    • Popular
    • Comments
    • Tags
    • forexcommunity

      Highlighting what’s important about questions & Answers on Discy Community!

      • 0 Comments
    • forexcommunity

      Introducing Keyboard Shortcuts, our first Labs feature

      • 0 Comments
    • forexcommunity

      Defining quality on Discy Engine — what a helpful answer ...

      • 0 Comments
    • forexcommunity

      Organizational and company accounts on Discy Engine the next step

      • 0 Comments
    • forexcommunity

      Hello world!

      • 0 Comments

    Related Questions

    • Brus Agell

      Правельный выбор

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 2 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 0 Answers
    • c00l777

      Optimization results differ on different accounts

      • 3 Answers

    Users

    Geraldimaky

    Geraldimaky

    • 0 Questions
    • 0 Answers
    Jeffreytix

    Jeffreytix

    • 0 Questions
    • 0 Answers
    RobertFoeta

    RobertFoeta

    • 0 Questions
    • 0 Answers

    Footer

    First independent community of traders

    About

    An independent community of forex traders. This is where traders communicate. You can ask your questions and you will receive an answer to your question.
    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Knowledge Base
    • Support

    © 2021 Forexcommunity.net. All Rights Reserved