Recording P/L and margin used
Results 1 to 10 of 10

Thread: Recording P/L and margin used

  1. #1
    Is there any way? I understand the document can get enormous but I do not mind. I suppose a lot of traders would find this valuable. Thank you

  2. #2
    It is possible. This line will do within an Expert:

    Printing (Balance:,AccountBalance(),; Equity:, AccountEquity(),; FreeMargin:, AccountFreeMargin());

  3. #3
    On account of

    Will it be from the log documents MT keeps?

    Thanks again.
    S

  4. #4
    Quote Originally Posted by ;
    Thanks,

    Can it be in the log documents MT keeps?

    Thanks again.
    S
    Yes, look in the experts/logs directory.

  5. #5
    I wouldn't print it, I would let MT write it into a new file that not all of the stuff is in the same file.

  6. #6
    Quote Originally Posted by ;
    I wouldn't print it, I'd rather let MT write it into a new file so that not all of the other stuff is at the exact same file.
    How do I do this?

  7. #7
    Quote Originally Posted by ;
    How do I do that?
    See the MQL manual on document management, functions are (I believe ) fopen, fwrite and fclose.

  8. #8
    I discovered this EA that really does something like (it displays the spreads in a CSV file). I'm not too proficient at mql if anyone could alter this I'd really be grateful. I'm sure other will find it very helpful also
    https://forexintuitive.com/attachmen...9909397690.mq4

  9. #9
    Something like this?
    File PL_Margin. Csv will include the data for every tick...

    It will be a huge file after some time. Should you exchange multi-currency leave the if condition out.


    Inserted Code double OrdersProfit=0; int I; for( I=0; I lt; OrdersTotal(); I ) OrderSelect( I, SELECT_BY_POS, MODE_TRADES ); if ( OrderSymbol() == Symbol() ) OrdersProfit = OrderProfit(); int Handle = FileOpen(PL_Margin. Csv, FILE_CSV | FILE_READ | FILE_WRITE,;-RRB-; FileSeek(Handle, FileSize(Handle), SEEK_SET); FileWrite(Handle, AccountBalance(), AccountEquity(),AccountMargin(), AccountFreeMargin(), OrdersProfit); FileClose(Handle);

  10. #10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners more information