MetaTrader4がメインですがその他色々
もし何か役に立ったら押してください(*´д`) コメントも送れます。
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
自分のアカウントと、通貨ペアの状態を表示することが出来ます。アカウントや通貨ペアの詳細を知りたいときに便利です。
レバレッジや、最小ロット数も表示されます。
↓以下コードです。新しいインジケーターとして保存してください。
1.F4キーでMetaEditorを呼び出し。
2.新しいIndicatorを作成。
3.ペーストしてコンパイル(F5)
4.カスタムインジケーターに追加されます。
#property copyright ""
#property link ""
#property indicator_chart_window
extern int x = 20 ;
extern int y = 8;
extern int size= 9 ;
extern bool ShowMarketInfo = true;
extern bool ShowAccountStatus = true;
extern string myobj = "uGj8JgG7"; // random string to give unique name to the objects
extern double startinglevel = 2.0345;
extern color textcolor = White;
extern int startbarno = 1;
extern int spacebetweenlines = 5;
double nextlinelevel = 0;
int counter = 0;
int init()
{
AccountStatus();
GetMarketInfo();
return(0);
}
int deinit()
{int i;
for (i=counter;i>0;i--)
ObjectDelete(myobj+i);
return(0);}
int start()
{int counted_bars=IndicatorCounted();
return(0);}
int PrintOnGraph(string mytext)
{if (nextlinelevel == 0)
nextlinelevel = startinglevel;
else
nextlinelevel = nextlinelevel -spacebetweenlines*Point;
counter++;
ObjectCreate(myobj+counter, OBJ_LABEL, 0, Time[startbarno], nextlinelevel);
ObjectSet(myobj+counter, OBJPROP_CORNER, 0);
ObjectSet(myobj+counter, OBJPROP_XDISTANCE, x);
ObjectSet(myobj+counter, OBJPROP_YDISTANCE, 10+counter*(size+1));
ObjectSet(myobj+counter, OBJPROP_COLOR, textcolor);
ObjectSet(myobj+counter, OBJPROP_BACK, false);
ObjectSetText(myobj+counter, mytext, size);
return ( 0 );}
int AccountStatus()
{if(ShowAccountStatus == True )
{ PrintOnGraph ("AccountBalance: "+ DoubleToStr(AccountBalance(),Digits));
PrintOnGraph ("AccountCompany: "+ DoubleToStr(AccountCompany(),Digits));
PrintOnGraph ("AccountCredit: "+ DoubleToStr(AccountCredit(),Digits));
PrintOnGraph ("AccountCurrency: "+ DoubleToStr(AccountCurrency(),Digits));
PrintOnGraph ("AccountEquity: "+ DoubleToStr(AccountEquity(),Digits));
PrintOnGraph ("AccountFreeMargin: "+ DoubleToStr(AccountFreeMargin(),Digits));
PrintOnGraph ("AccountLeverage: "+ DoubleToStr(AccountLeverage(),Digits));
PrintOnGraph ("AccountMargin: "+ DoubleToStr(AccountMargin(),Digits));
PrintOnGraph ("AccountName: "+ AccountName());
PrintOnGraph ("AccountNumber: "+ DoubleToStr(AccountNumber(),Digits));
PrintOnGraph ("AccountProfit: "+ DoubleToStr(AccountProfit(),Digits));
} return ( 0 );}
int GetMarketInfo()
{
// Vyvodim informatsiyu o rynke
if ( ShowMarketInfo == True )
{
PrintOnGraph("Low: "+DoubleToStr(MarketInfo(Symbol(), MODE_LOW),Digits));
PrintOnGraph("High: "+DoubleToStr(MarketInfo(Symbol(), MODE_HIGH),Digits));
PrintOnGraph("ModeTime: "+DoubleToStr(MarketInfo(Symbol(), MODE_TIME),Digits));
// PrintOnGraph("Bid: "+DoubleToStr(MarketInfo(Symbol(), MODE_BID),Digits));
// PrintOnGraph("Ask: "+DoubleToStr(MarketInfo(Symbol(), MODE_ASK),Digits));
PrintOnGraph("ModePoint: "+DoubleToStr(MarketInfo(Symbol(), MODE_POINT),Digits));
PrintOnGraph("ModeDigits: "+DoubleToStr(MarketInfo(Symbol(), MODE_DIGITS),Digits));
PrintOnGraph("Spread: "+DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD),Digits));
PrintOnGraph("ModeStopLevel: "+DoubleToStr(MarketInfo(Symbol(), MODE_STOPLEVEL),Digits));
PrintOnGraph("ModeFreezeLevel: "+DoubleToStr(MarketInfo(Symbol(), MODE_FREEZELEVEL),Digits));
PrintOnGraph("ModeLotSize: "+DoubleToStr(MarketInfo(Symbol(), MODE_LOTSIZE),Digits));
// PrintOnGraph("ModeTickValue: "+DoubleToStr(MarketInfo(Symbol(), MODE_TICKVALUE),Digits));
// PrintOnGraph("ModeTickSize: "+DoubleToStr(MarketInfo(Symbol(), MODE_TICKSIZE),Digits));
PrintOnGraph("SwapLong: "+DoubleToStr(MarketInfo(Symbol(), MODE_SWAPLONG),Digits));
PrintOnGraph("SwapShort: "+DoubleToStr(MarketInfo(Symbol(), MODE_SWAPSHORT),Digits));
PrintOnGraph("ModeStarting: "+DoubleToStr(MarketInfo(Symbol(), MODE_STARTING),Digits));
PrintOnGraph("ModeExpiration: "+DoubleToStr(MarketInfo(Symbol(), MODE_EXPIRATION),Digits));
PrintOnGraph("ModeTradeAllowed: "+DoubleToStr(MarketInfo(Symbol(), MODE_TRADEALLOWED),Digits));
PrintOnGraph("ModeMinLot: "+DoubleToStr(MarketInfo(Symbol(), MODE_MINLOT),Digits));
PrintOnGraph("ModeLotStep: "+DoubleToStr(MarketInfo(Symbol(), MODE_LOTSTEP),Digits));
}
return (0);}
#property link ""
#property indicator_chart_window
extern int x = 20 ;
extern int y = 8;
extern int size= 9 ;
extern bool ShowMarketInfo = true;
extern bool ShowAccountStatus = true;
extern string myobj = "uGj8JgG7"; // random string to give unique name to the objects
extern double startinglevel = 2.0345;
extern color textcolor = White;
extern int startbarno = 1;
extern int spacebetweenlines = 5;
double nextlinelevel = 0;
int counter = 0;
int init()
{
AccountStatus();
GetMarketInfo();
return(0);
}
int deinit()
{int i;
for (i=counter;i>0;i--)
ObjectDelete(myobj+i);
return(0);}
int start()
{int counted_bars=IndicatorCounted();
return(0);}
int PrintOnGraph(string mytext)
{if (nextlinelevel == 0)
nextlinelevel = startinglevel;
else
nextlinelevel = nextlinelevel -spacebetweenlines*Point;
counter++;
ObjectCreate(myobj+counter, OBJ_LABEL, 0, Time[startbarno], nextlinelevel);
ObjectSet(myobj+counter, OBJPROP_CORNER, 0);
ObjectSet(myobj+counter, OBJPROP_XDISTANCE, x);
ObjectSet(myobj+counter, OBJPROP_YDISTANCE, 10+counter*(size+1));
ObjectSet(myobj+counter, OBJPROP_COLOR, textcolor);
ObjectSet(myobj+counter, OBJPROP_BACK, false);
ObjectSetText(myobj+counter, mytext, size);
return ( 0 );}
int AccountStatus()
{if(ShowAccountStatus == True )
{ PrintOnGraph ("AccountBalance: "+ DoubleToStr(AccountBalance(),Digits));
PrintOnGraph ("AccountCompany: "+ DoubleToStr(AccountCompany(),Digits));
PrintOnGraph ("AccountCredit: "+ DoubleToStr(AccountCredit(),Digits));
PrintOnGraph ("AccountCurrency: "+ DoubleToStr(AccountCurrency(),Digits));
PrintOnGraph ("AccountEquity: "+ DoubleToStr(AccountEquity(),Digits));
PrintOnGraph ("AccountFreeMargin: "+ DoubleToStr(AccountFreeMargin(),Digits));
PrintOnGraph ("AccountLeverage: "+ DoubleToStr(AccountLeverage(),Digits));
PrintOnGraph ("AccountMargin: "+ DoubleToStr(AccountMargin(),Digits));
PrintOnGraph ("AccountName: "+ AccountName());
PrintOnGraph ("AccountNumber: "+ DoubleToStr(AccountNumber(),Digits));
PrintOnGraph ("AccountProfit: "+ DoubleToStr(AccountProfit(),Digits));
} return ( 0 );}
int GetMarketInfo()
{
// Vyvodim informatsiyu o rynke
if ( ShowMarketInfo == True )
{
PrintOnGraph("Low: "+DoubleToStr(MarketInfo(Symbol(), MODE_LOW),Digits));
PrintOnGraph("High: "+DoubleToStr(MarketInfo(Symbol(), MODE_HIGH),Digits));
PrintOnGraph("ModeTime: "+DoubleToStr(MarketInfo(Symbol(), MODE_TIME),Digits));
// PrintOnGraph("Bid: "+DoubleToStr(MarketInfo(Symbol(), MODE_BID),Digits));
// PrintOnGraph("Ask: "+DoubleToStr(MarketInfo(Symbol(), MODE_ASK),Digits));
PrintOnGraph("ModePoint: "+DoubleToStr(MarketInfo(Symbol(), MODE_POINT),Digits));
PrintOnGraph("ModeDigits: "+DoubleToStr(MarketInfo(Symbol(), MODE_DIGITS),Digits));
PrintOnGraph("Spread: "+DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD),Digits));
PrintOnGraph("ModeStopLevel: "+DoubleToStr(MarketInfo(Symbol(), MODE_STOPLEVEL),Digits));
PrintOnGraph("ModeFreezeLevel: "+DoubleToStr(MarketInfo(Symbol(), MODE_FREEZELEVEL),Digits));
PrintOnGraph("ModeLotSize: "+DoubleToStr(MarketInfo(Symbol(), MODE_LOTSIZE),Digits));
// PrintOnGraph("ModeTickValue: "+DoubleToStr(MarketInfo(Symbol(), MODE_TICKVALUE),Digits));
// PrintOnGraph("ModeTickSize: "+DoubleToStr(MarketInfo(Symbol(), MODE_TICKSIZE),Digits));
PrintOnGraph("SwapLong: "+DoubleToStr(MarketInfo(Symbol(), MODE_SWAPLONG),Digits));
PrintOnGraph("SwapShort: "+DoubleToStr(MarketInfo(Symbol(), MODE_SWAPSHORT),Digits));
PrintOnGraph("ModeStarting: "+DoubleToStr(MarketInfo(Symbol(), MODE_STARTING),Digits));
PrintOnGraph("ModeExpiration: "+DoubleToStr(MarketInfo(Symbol(), MODE_EXPIRATION),Digits));
PrintOnGraph("ModeTradeAllowed: "+DoubleToStr(MarketInfo(Symbol(), MODE_TRADEALLOWED),Digits));
PrintOnGraph("ModeMinLot: "+DoubleToStr(MarketInfo(Symbol(), MODE_MINLOT),Digits));
PrintOnGraph("ModeLotStep: "+DoubleToStr(MarketInfo(Symbol(), MODE_LOTSTEP),Digits));
}
return (0);}
PR
この記事にコメントする
カテゴリー
最新記事
(03/03)
(05/31)
(11/09)
(11/09)
(06/27)
(06/21)
(07/01)
解析タグ
P R