Need help for coding rollover/spread table

free & uncensored discussion arena for TheRumpledOne

Moderator: moderators

pipstar
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Fri Sep 18, 2009 10:27 am
Reputation: 0
Gender: None specified

Need help for coding rollover/spread table

Postby pipstar » Fri Sep 18, 2009 11:04 am

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 :wink:

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
Attachments
eurusd.gif
eurusd.gif (11.91 KiB) Viewed 1932 times

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
flinux
rank: 150+ posts
rank: 150+ posts
Posts: 219
Joined: Wed May 27, 2009 9:52 pm
Reputation: 2
Gender: Male
Contact:

Postby flinux » Sat Sep 19, 2009 2:48 pm

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.
Attachments
FLI_SSRTABLE.mq4
(1.61 KiB) Downloaded 187 times

pipstar
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Fri Sep 18, 2009 10:27 am
Reputation: 0
Gender: None specified

Postby pipstar » Mon Sep 21, 2009 6:54 am

Great work Flinux, really appreciate it, thank you very much !

nice day to you :)

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “TheRumpledOne”