partially closing strategy combined with Martingale/Grid.
-
Help me write a method to implement a partially closing strategy combined with Martingale/Grid.
My conditions:
I have hedged both buy and sell positions at 1.5 lots.
I opened a new position using Martingale starting with 0.2 lots.
What I need:
If the Martingale position generates profit, I want to gradually reduce the hedged position (1.5 lots) by closing portions of it step by step, e.g., from 0.2 lots to 0.1 lots, and so on.However, I couldn’t implement this logic successfully. Please help me!
 shared/2YJ0KxiR link text
-
I need as this
shared/2YJ0KxiR
-
This is a big project to be reviewed. There is no immediate solution for what you want. What do you exactly mean by 'If the Martingale position generates profit'? Do you mean profit with the open trades at this moment of considering the closed ones too?