- How to plot Profit & Loss? Nobody know?
- How to get AccountProfit of an specific time?
- A maximum problem
By the way, people usually use this function in experts :) But u can simply add in ur indicator
AccountProfit(); // or Print( " Profit : ",AccountProfit()); // shows ur profit(if u have some :))If u still haven't understood attach ur indicator & show me how u want to use this function i will help u.
hello mymql4,
what do you mean by plotting it? AccountProfit() shows the sum of your opened positions profits +/- swaps, it doesn't have anything to do with the chart prices.
If you want to see it plotted take a look at Graph while backtesting, or you can add it as a line in the Comment() function while live testing to see it on the main window.
Good luck,
hello mymql4,
what do you mean by plotting it? AccountProfit() shows the sum of your opened positions profits +/- swaps, it doesn't have anything to do with the chart prices.
If you want to see it plotted take a look at Graph while backtesting, or you can add it as a line in the Comment() function while live testing to see it on the main window.
Good luck,
Hello Forexfordinner,
10 searches and 4 hours later I found this which appears to work real time -
//+------------------------------------------------------------------+
//| Current_Profits.mq4 |
//| Copyright © 2008, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Yellow
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
ExtMapBuffer1[0] = AccountProfit();
return(0);
}
//+------------------------------------------------------------------+
By the way, people usually use this function in experts :) But u can simply add in ur indicator
If u still haven't understood attach ur indicator & show me how u want to use this function i will help u.Hello Seifer, I tried adding to an custom indicator but got into variables issues so above seems
to work.
Hello Seifer, I tried adding to an custom indicator but got into variables issues so above seems
to work.
CAN SOMEONE PLEASE HELP HERE!!??? THIS WOULD BE VERY USEFUL FOR ME IF I CAN GRAPH ACCOUNT PROFIT AS A HISTOGRAM, EVEN ON A 5 MIN CHART NOT BY THE TIC. PLEASE HELP. Daniel
Please don't scream or at least wait more than 22minutes between posts before u do.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use