Comparing yesterday and today in an EA

To add comments, please log in or register
vishnurama
14
vishnurama  

Good day ,

  Help with my EA. Before start trading everyday , I want my code to compare yesterday's AccountBalance to today's. If today's AccountBalance is greater than or equal to 5% than yesterday , then stop trading. Here's what I thought about it :


if ( //AccountBalance is >= 5% than yesterday's ) {
      // return;
   } else {
      // starttrading();
   }

I'm also thinking about do-while loop whereby ,

      as long as today's or at the start of the day's balance is not greater than or equal to 5% , call starttrading()

The thing is , I'm not sure how to compare today's balance with yesterday's.

Any ideas are much appreciated.


Thanks.

To add comments, please log in or register