Hi all, Hi Mr Horton , im trying to code a simple table on a metatrader chart for see all the swap long, swap short and spread all together for the 4 major pairs in the market watch window (or other that can add after).
The code im trying to build is :
#property copyright "Copyright ? 2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
int start()
{
string sComment = "";
string sp = "-------------------------------------------------------------------------\n";
string NL = "\n";
sComment = sComment + sp;
sComment = sComment + " Pairs | Swap Buy | Swap Sell | Spread |";
sComment = sComment + NL + sp;
sComment = sComment + " Pair Name 1 ";
sComment = sComment + " | " + DoubleToStr(MarketInfo(Symbol(), MODE_SWAPLONG),2);
sComment = sComment + " | " + DoubleToStr(MarketInfo(Symbol(), MODE_SWAPSHORT),2);
sComment = sComment + " | " + DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD)*0.1, 1);
sComment = sComment + " |";
sComment = sComment + NL + " Pair Name 2 |";
sComment = sComment + NL + " Pair Name 3 |";
sComment = sComment + NL + " Pair Name 4 |";
Comment(sComment);
return(0);
}
Now, how can i tell with a metaeditor command to retrieve swaplong, swapshort and spread for the other pairs that isnt in the chart actually ? Sorry for my english, its my first indicator in mql language
Ive seen all the beautiful indicator with tables, values, that TRO have done, can please help done similar look ?
Below a screen of the result
thanks in advance
Need help for coding rollover/spread table
Moderator: moderators
Need help for coding rollover/spread table
- Attachments
-
- eurusd.gif (11.91 KiB) Viewed 1933 times
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
Done.
It's not really nice to see.. but it works.
Remember to modify the "q" array, if you don't use mini-lots.
Replace Example:
string q[] = {"EURUSDm","GBPUSDm","USDJPYm","EURJPYm","GBPJPYm","USDCHFm","USDCADm","NZDUSDm"};
with:
string q[] = {"EURUSD","GBPUSD","USDJPY","EURJPY","GBPJPY","USDCHF","USDCAD","NZDUSD"};
Have a nice day.
It's not really nice to see.. but it works.
Remember to modify the "q" array, if you don't use mini-lots.
Replace Example:
string q[] = {"EURUSDm","GBPUSDm","USDJPYm","EURJPYm","GBPJPYm","USDCHFm","USDCADm","NZDUSDm"};
with:
string q[] = {"EURUSD","GBPUSD","USDJPY","EURJPY","GBPJPY","USDCHF","USDCAD","NZDUSD"};
Have a nice day.
- Attachments
-
- FLI_SSRTABLE.mq4
- (1.61 KiB) Downloaded 187 times
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.