Do me a favour will you, when you have time? Cast your eyes over the attached and see if you can work out why it does not perform as I want.
What is supposed to happen is this:
- NB finds a negative trade and calls RecoveryModule()
- if RecoveryModule() finds the trade is not deeply enough into dd to warrant recovery, it aborts the process
- if the trade is deep enough into dd to warrant recovery, NB adds 20 or 40 to the magic number, to allow re-entries.
- when a re-entry is made, calls CheckRecoveryTakeProfit(). This uses code pinched from iExposure to calculate the breakeven tp and modify the trades' tp's.
1, 2 and 4 work fine - I know 4 works because I had some code in the wrong order and NB was altering the tp as soon as the trade entered Recovery territory.
I had to do some alteration to the magic number thigy. We do not need different mn's for each trading method, so I have stripped all that out and replaced it with a single mn that can be incremented to allow NB to send recovery trades.
Step 3 does not appear to happen; re-entries are not happening. I was going to try to sort this out this morning, but Bob is cooking something and wanted an ea to allow him to experiment and I have been coding that.
RecoveryInProgress is set when a trade goes into recovery territory. Once a further trade us sent, TpMoved is set to true once all the tp's have been successfully modified, so the robot does not have to keep on looking.
I have to go out to teach soon, and will be out for the rest of today.
Can you see why step 3 is not happening?