Progressive lots sizing based on account balance and tracking balance
Results 1 to 4 of 4

Thread: Progressive lots sizing based on account balance and tracking balance

  1. #1
    Hey guys,

    Have a question about a code.
    Im hoping to use a progressive system only when my current account balance is under a'high' of my account balance.

    So basically I have the following:

    if (equityStart lt; AccountBalance())

    equityStart = AccountBalance();


    equityStart is an initial balance I have (therefore its the first'high' of my account balance. If my account balance heads south off there then it will start the progression. If some of my following trades (im not martingaling) are powerful and my account balance is higher than equityStart, then I wanted equityStart to equal the account balance then go back to the initial lot size at the development and remain there until my account balance decreases again. Basically when im at a pit using my development method.

    The only issue is its not functioning and im not sure what code I truly must implement to get it keep an eye on everything.

    Is there some formal method of coding the above?

    cheers

  2. #2
    No, im not continually increasing lot sizes. Progressive was an incorrect word.
    I want in order base following trades on various lot sizes in a manner that is progressive (innovative as in from commerce 2 onwards).

    The innovative trades are not always increasing in size, infact they're varying.

    Thank you for the answer, I see what your saying regarding the restart. Would you advoe getting around this matter?

  3. #3
    Wait, so you want to boost your risk if your account goes under the account high watermark? That's a sure way to blow cash as soon as your egy is not working well and leave it to the table once the egy is in tune with the market. Just saying.

    Initial thought in your code:
    Your code is only going to work during that 1 case of the EA. If you restart it, then you reset the large watermark to whatever the balance is at the time in the new case.

  4. #4
    Quote Originally Posted by ;
    No, im not always increasing lot sizes. Progressive was an incorrect word to describe it.
    I would like to be able base after trades on different lot sizes in a progressive manner (innovative as in from trade 2 onwards).
    Still do not feel a previous trade result should impact a future trade size (out of risk scaling together with the account balance in a linear manner.) I mean, the results of a previous trade has zero effect on the possible results of a future trade, so mixing variance here can not, in theory, increase your yields over a big enough sample of transactions.

    But anyhow. .

    Quote Originally Posted by ;
    Thank you for the answer, I see what your saying regarding the resume. How would you recommend getting about that matter?
    Maybe shop the value as a global variable rather than a variable only used from the EA? That would address the matter with the EA re-initializing and shedding beyond high watermarks. You should have the ability to quit and restart MT4 and retain the variable. The only problem today is, porting the EA into a new set up of MT4 would start a new variable.

    Other ways would be writing the value into a log file during deinit() and reading that document each time the EA starts again. That would produce the value mobile with the EA should you transfer it (plus the file) into the new MT4 instance.

    (In case a more seasoned programmer knows a better way, please talk )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.