EarnForex / PositionSizer

Calculate your position size based on the risk and account size and execute your trades with this free MetaTrader expert advisor.
https://www.earnforex.com/metatrader-expert-advisors/Position-Sizer/
Apache License 2.0
385 stars 153 forks source link

chaging initial risk to reset symbols to default #20

Closed paymanz closed 3 years ago

paymanz commented 3 years ago

It would be more logical if when you change the initial risk in inputs menu to reset all symbols initial risk. Right now it reads the values from symbol specific setting that is saved in "file" directory.

Thanks in advance.

EarnForex commented 3 years ago

Hello!

Thanks for your suggestion! However, I am not sure that it would be a more logical thing to do. I am an active user of the PSC myself and that would definitely mess up things for me. Generally, I consider input parameters to be related to the chart (which is also a currency pair) the indicator is being attached to and should not be related to change in some other currency pairs.

paymanz commented 3 years ago

Hello!

Thanks for your suggestion! However, I am not sure that it would be a more logical thing to do. I am an active user of the PSC myself and that would definitely mess up things for me. Generally, I consider input parameters to be related to the chart (which is also a currency pair) the indicator is being attached to and should not be related to change in some other currency pairs.

Is it possible to hint me to make a small edit so my panel's risk/lot size not being symbol specific and being universal. For me that would be much better , im using same risk regardless of symbol. I just change my risk based on the setup and/or my risk tolerance on that particular moment.

EarnForex commented 3 years ago

That might be rather difficult to modify. However, you could try removing the lines responsible for reading the Risk value from the settings file. Those are these lines in the QCPositionSizeCalculator::LoadSettingsFromDisk() function:

       else if (var_name == "Risk")
        sets.Risk = StringToDouble(var_content);
       else if (var_name == "MoneyRisk")
        sets.MoneyRisk = StringToDouble(var_content);
paymanz commented 3 years ago

That might be rather difficult to modify. However, you could try removing the lines responsible for reading the Risk value from the settings file. Those are these lines in the QCPositionSizeCalculator::LoadSettingsFromDisk() function:

     else if (var_name == "Risk")
      sets.Risk = StringToDouble(var_content);
     else if (var_name == "MoneyRisk")
      sets.MoneyRisk = StringToDouble(var_content);

Haha , yeah appears to be more complex than that. Tried what you suggested but it just changes the risk to zero.

EarnForex commented 3 years ago

Yeah, you might also need to move this statement: sets.Risk = DefaultRisk; // Risk tolerance in percentage points out of the scope of this condition in PositionSizeCalculator.mq4 (or .mq5): if (!ExtDialog.LoadSettingsFromDisk())

paymanz commented 3 years ago

Yeah, you might also need to move this statement: sets.Risk = DefaultRisk; // Risk tolerance in percentage points out of the scope of this condition in PositionSizeCalculator.mq4 (or .mq5): if (!ExtDialog.LoadSettingsFromDisk())

Appreciate your help , but still not working. It sets the risk to zero.

EarnForex commented 3 years ago

Do you have a non-zero default Risk input parameter? Does removing and adding the indicator again with some non-zero Risk input parameter result in setting the Risk field to zero?

paymanz commented 3 years ago

Do you have a non-zero default Risk input parameter? Does removing and adding the indicator again with some non-zero Risk input parameter result in setting the Risk field to zero?

Yes the input is not zero , I also tried to add the indicator in another chart and still its zero risk.

EarnForex commented 3 years ago

That's weird. I've just made the changes I described and it worked fine. PositionSizeCalculator.zip Try the attached compiled version.

paymanz commented 3 years ago

That's weird. I've just made the changes I described and it worked fine. PositionSizeCalculator.zip Try the attached compiled version.

Oh thank you it works! Can I please have mq4 file as well please?

EarnForex commented 3 years ago

Sure, but please take into account that this version has some not-so-well-tested features there, so be careful with it: PositionSizeCalculator.zip