Hello Guys,
I made a bool function to count my positive and negative trades daily, if there is more then 3 it returns true.
In backtesting it works because all positionated volume closes at once.
In real trades, the volume is closed in parts, so the function counts more then 1 positive trade and returns true.
I couldn't find a code that counts "POSITIONS OUT" only "DEALS OUT". Someone solved this problem?
I haven't tried before, but would it help to look through orders instead of deals?
or if you prefer to stick to deals, how about checking DEAL_ORDER to make sure only unique ones are counted?
how about checking DEAL_ORDER to make sure only unique ones are counted?
Didn't work, so I used the DEAL_POSITION_ID to count only the first ORDER OUT, then it worked!
DEAL_POSITION_ID is the same during the entire lifetime of the position.
DEAL_ORDER changes during the position.
thanks for the tip :)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Guys,
I made a bool function to count my positive and negative trades daily, if there is more then 3 it returns true.
In backtesting it works because all positionated volume closes at once.
In real trades, the volume is closed in parts, so the function counts more then 1 positive trade and returns true.
I couldn't find a code that counts "POSITIONS OUT" only "DEALS OUT". Someone solved this problem?