Mt4 Ea Part To Check Tradehistory

what i need is a part of a code for an EA.

This part should check the history of trades and do as followed:
there is an integer which starts with 0.

As soon as there are 4 loosing trades found in the tradehistory, the script should add 1 to this integer. So if the last 4 trades with the specific magicnumber are all not profitable, the integer should have value 1. If the last 8 trades with the specific magicnumber are all not profitable, the integer should have value 2.
Also, i want another integer which starts at 1 and shows me at which position of the 4 the ea is at the moment. So if there are 2 loosing trades in history till a winning trade was made, than now we are at tradenumber 3. If there are 5 loosing trades in history till a profitable trade, than now we are at trade number 6.

Only short piece of code i think..Please bid according.

Leave a Reply

Your email address will not be published. Required fields are marked *