i buy 1.2500 then increased 2 pips become 1.2520 and so on
That's a 20 pip increase not 2
Your question is not clear.
Your question is too vague
I or someone will help you, but you have to write some code first.
Try to break up what you have written into logical steps and write code for one step at a time.
does 4 digits broker still exist?
The best way to learn is try, even though you make mistakes.
You will unlikely find anyone here willing to write the code for you, because most people do not learn from that.
We have had many new coders ask for examples and then they are back with the same problems over and over again.