本帖最后由 tpy 于 2009-10-22 20:53 编辑 [T`}yb@ Q.k
:\m*h 这一小程序,是初步框架,供探讨。
Close_Open.mq5 (20 K) 下载次数:28 \&a.}t cS|VJWgTZ 2yKz-"E //+------------------------------------------------------------------+
@u)
'yS //| Close_Open.mq5 |
Ftv8@l //| Copyright |
Z0ReWrl;` //| |
|NrrTN?> //+------------------------------------------------------------------+
0mexF@ #property copyright ""
A+
0,i #property link ""
l#bAl/c` #property version "1.00"
lIf(6nm@ int TakeProfit=50;
"Xn%at4 int StopLoss=30;
&ZJgQ-Pc(m double Lots=0.1;
?Zz'|.l@ //+------------------------------------------------------------------+
*P2[qhP2 //| Expert initialization function |
D59T?B|BdD //+------------------------------------------------------------------+
'Qn~H[$/p int OnInit()
A^Cj1:, {
RL}KAGK if(Digits()==5)
P7GRSjG {
P $>` TakeProfit=500;
1BTIJ G w StopLoss=300;
R+=a`0_S }
RiFw?Q+ else if(Digits()==4)
Q9>U1]\ {
~&VN_;j_ TakeProfit=50;
Utt>H@t[ StopLoss=30;
_ PWj(}); }
U;^[$Aq t#~?{i@m CreateTradeObject();
d53 L65[ //InitEA();
lZ+!H=` ChartRedraw();
iI?{"}BZ return(0);
)pgrl }
WS0JS' //+------------------------------------------------------------------+
jX
*/piSq //| Expert deinitialization function |
zQ8!rCkg4 //+------------------------------------------------------------------+
`rFAZcEj% void OnDeinit(const int reason)
=xl~][ {
B@K[3 //---
;st\I ObjectDelete(0,"CloseAll");
X;GfPw.m ObjectDelete(0,"CloseProfit");
#@//7Bf% ObjectDelete(0,"CloseLoss");
Fr:5$,At7- ObjectDelete(0,"OpenBuy");
i$Z#9M9 ObjectDelete(0,"OpenSell");
Re[:qLa] :c8^db`" ObjectDelete(0,"LotsLabel");
8jnz}aBd ObjectDelete(0,"Lots");
F[E?A95W ObjectDelete(0,"LotsIncrease");
@.$MzPQQI ObjectDelete(0,"LotsDecrease");
;VzMU ;j &RY