#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Home
Forex Forum
+ Add Script
Metastock
Expert Advisors
Explorations
Indicators
Trading Systems
Metatrader
MQL Experts
MQL Indicators
MQ4 Experts
MQ4 Indicators
MQ4 Scripts
Tradestation
Functions
Indicators
PaintBars
ShowMe
Trading Systems
Amibroker
Commentaries
Explorations
Functions
Indicators
Trading Systems
Contact us
Newsletter
Group: Metatrader MQ4 Scripts
Title: Tracert
Description:
Tracert
//+------------------------------------------------------------------+ //| Tracert.mq4 | //| Rosh | //| http://forexsystems.ru/phpBB/index.php | //+------------------------------------------------------------------+ #property copyright "Rosh" #property link "http://forexsystems.ru/phpBB/index.php" //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ double tr_AOPLong,tr_AOPShort; double tr_LongLots,tr_ShortLots; int tr_CurrLongOrders,tr_CurrShortOrders; int tr_Total,tr_Counter; int tr_PrevLongOrders,tr_PrevShortOrders; int tr_CurrTotalOpenedOrders,tr_PrevTotalOpenedOrders; double tr_CurrBalance,tr_PrevCurrBalance; color tr_ProfitColor=Lime, tr_LossColor=DeepPink,tr_LongAOPColor=Blue,tr_ShortAOPColor=Red, tr_CurrCloseColor; int tr_CloseLabelArrow=108, tr_AOPLabelArrow=159; bool tr_CloseLong,tr_CloseShort; double tr_CloseLabelPrice; int tr_CloseLabelShift=20; int tr_CounterCloseLabel=0,tr_CounterAOPLabel=0; int tr_Bars; void SetTrace() { //---- if (IsTesting()&&(tr_Bars!=Bars)) { tr_CloseLong=false; tr_CloseShort=false; tr_AOPLong=0.0; tr_AOPShort=0.0; tr_LongLots=0.0; tr_ShortLots=0.0; tr_CloseLabelShift=iATR(NULL,0,50,1)*3.0/10.0/Point; if (tr_CurrBalance==0.0) { tr_CurrBalance=AccountBalance(); tr_PrevCurrBalance=AccountBalance(); } //----------------???????? ???????? ??????? --------------------------- tr_CurrLongOrders=0; tr_CurrShortOrders=0; tr_CurrTotalOpenedOrders=0; tr_Total=OrdersTotal(); if (tr_Total>0)// ???? ???????? ??????? { for (tr_Counter=0;tr_Counter
0) tr_AOPLong=tr_AOPLong/tr_LongLots; if (tr_CurrShortOrders>0)tr_AOPShort=tr_AOPShort/tr_ShortLots; //--------------- ?????????? --------------------- if (tr_AOPLong>0.0) { ObjectCreate("AOP"+tr_CounterAOPLabel,OBJ_ARROW,0,Time[1],tr_AOPLong);// ?? ?????? ?????????, ?? ???? ?????? ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_ARROWCODE,tr_AOPLabelArrow); ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_COLOR,tr_LongAOPColor); tr_CounterAOPLabel++; } if (tr_AOPShort>0.0) { ObjectCreate("AOP"+tr_CounterAOPLabel,OBJ_ARROW,0,Time[1],tr_AOPShort);// ?? ?????? ?????????, ?? ???? ?????? ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_ARROWCODE,tr_AOPLabelArrow); ObjectSet("AOP"+tr_CounterAOPLabel,OBJPROP_COLOR,tr_ShortAOPColor); tr_CounterAOPLabel++; } // Print("Long=",tr_CurrLongOrders," tr_AOPLong=",tr_AOPLong," *** Short=",tr_CurrShortOrders," tr_AOPShort=",tr_AOPShort); tr_CurrTotalOpenedOrders=tr_CurrLongOrders+tr_CurrShortOrders; if ((tr_CurrTotalOpenedOrders!=tr_PrevTotalOpenedOrders)||(tr_PrevLongOrders!=tr_CurrLongOrders)||(tr_PrevShortOrders!=tr_CurrShortOrders)) // ?????????? ????????? ??????? ? ????? { if (tr_PrevLongOrders>tr_CurrLongOrders) // ?????????? ????? ??????? ? Long { tr_CloseLong=true; tr_CloseLabelPrice=High[1]+tr_CloseLabelShift*Point; } if (tr_PrevShortOrders>tr_CurrShortOrders) // ?????????? ????? ??????? ? Short { tr_CloseShort=true; tr_CloseLabelPrice=Low[1]-tr_CloseLabelShift*Point; } tr_PrevLongOrders=tr_CurrLongOrders; tr_PrevShortOrders=tr_CurrShortOrders; tr_PrevTotalOpenedOrders=tr_CurrTotalOpenedOrders; } }// ???? ???????? ??????? //---------------- ???????? ????????? ??????? tr_CurrBalance=AccountBalance(); if (tr_CurrBalance!=tr_PrevCurrBalance)// ???????? ????????? Balance { if (tr_CurrBalance-tr_PrevCurrBalance>0.0) tr_CurrCloseColor=tr_ProfitColor; else tr_CurrCloseColor=tr_LossColor; tr_PrevCurrBalance=tr_CurrBalance; //------------------ ????????? ????? ???????? -------------------- ObjectCreate("Close"+tr_CounterCloseLabel,OBJ_ARROW,0,Time[1],tr_CloseLabelPrice); ObjectSet("Close"+tr_CounterCloseLabel,OBJPROP_ARROWCODE,tr_CloseLabelArrow); ObjectSet("Close"+tr_CounterCloseLabel,OBJPROP_COLOR,tr_CurrCloseColor); tr_CounterCloseLabel++; //------------------ ????????? ????? ???????? -------------------- }// ???????? ????????? Balance }//(IsTesting()) //---- // Print("Total=",tr_Total); tr_Bars=Bars; return(0); } //+------------------------------------------------------------------+
Author/Source:
Rosh
Forex Directory
|
Free Forex Strategies
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact