How to code Profit Target
In My EA project, the profit target is dependent on an MA cross.
When testing for validity, I get “strategy is not valid. Invalid profit target in pips definition. Value must be integer.” I think I must go back to the
Strategy Section, but what to do?
Would help if you posted the code, but sounds like you are trying to assign real number to the pips. Are you converting to pips first?
yes upload your saved strategy or screenshot of condition as you set them. This will help to solve the issue for you
Thank you for the instruction.Chris Fredericks
you had set and empty value for variable “ProfitTargetInPips”. Set some default value.
Also you need to modify variable type to “Double” for “MaximumLots”
Thank you, tomas262. I will remedy the “profit Target in Pips” and Maximun Lots.
Where should I find information about ” converting to pips “
Two main functions you can use in EA Wizard are:
ConvertToRealPips – converts 20 into 0.002
ConvertToPips – converts 0.002 to 20 pips
Did you mean this?
Yes.Thank you tomas262
Viewing 8 posts - 1 through 8 (of 8 total)