How to code Profit Target
7 replies
cfred15
8 years ago #114143
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?
Thank You.
Chris Fredericks
seaton
8 years ago #132394
Hi Chris,
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?
Stephen….
tomas262
8 years ago #132413
Hi,
yes upload your saved strategy or screenshot of condition as you set them. This will help to solve the issue for you
cfred15
8 years ago #132443
Thank you for the instruction.Chris Fredericks
tomas262
8 years ago #132452
Hello,
you had set and empty value for variable “ProfitTargetInPips”. Set some default value.
Also you need to modify variable type to “Double” for “MaximumLots”
cfred15
8 years ago #132473
Thank you, tomas262. I will remedy the “profit Target in Pips” and Maximun Lots.
Where should I find information about ” converting to pips “
cFred15
tomas262
8 years ago #132482
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?
cfred15
8 years ago #132558
Viewing 7 replies - 1 through 7 (of 7 total)