Author: EA更新地址
Price Data Components
Series array that contains the lowest prices of each barSeries array that contains the highest prices of each bar
Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open ordersIt can change open orders parameters, due to possible stepping strategyIt Closes Orders by itself
Miscellaneous
It issuies visual alerts to the screenIt plays sound alertsIt opens Message Boxes to the user
0 Views
0 Downloads
0 Favorites
MT4v1.4
ÿþ//|                                                  MT4cÓN©RKb.mq4 |

//|                                                              xyz |

//|                                                   xyz0217@qq.com |

#property copyright "EAôf°e0W@W"

#property link      "http://blog.sina.com.cn/s/blog_98c568c20102xma8.html"

#property version   "1.4"

#property description "O(uMRHQSbpSEAë_wc.•ô‹f‡eöN ‡eöN(WQØv-N QØv0W@W(W
Nb—b€wEA„vãNx (W4YèMOn"

#property strict

#define TP_PRICE_LINE "OG TP Price Line"

#define SL_PRICE_LINE "OG SL Price Line"



//QØv0W@W https://pan.baidu.com/s/1H5vIu8YTcivl3eZ3qtjKLg Æ[x pc1o ôf°eïSý€
NÊSöe

//QØv0W@W https://xyz0217.lanzoui.com/b02ccvfve  Æ[x 1111 ¹e¿ON}FOôf°eïSý€
NÊSöe

//QØv0W@W https://1drv.ms/f/s!Ag12rv4UaBTFdk21qQ-u-7ViriU   ôf°eÊSöeøvsQ‡eöNhQÿFOýV…Q¿‹î•
N3zš[ 4Nöe

//QØv0W@W https://mega.nz/folder/uN9A1D5b#5_ou1D3moJMYyVZVDQnATQ ôf°eÊSöe øvsQ‡eöNhQÿFOýV…Q¿‹î•
N3zš[

//EAôf°e0W@W http://blog.sina.com.cn/s/blog_98c568c20102xma8.html



//d"}š[MO  ttt OnTick()  tttt  OnTimer()  1111 ;NpeW[.• 1   Test KmՋ.•

/*

V1.4

îO9e†NN›N•ï‹ 2021.08.19

žX:_R¿~ãNxèRŸRý€ R¿~cUS R¿~s^ÓN R¿~_ÓN R¿~bkÈvbk_c 2018.05.31

žX RhQ@\ØSϑ ؞¤‹_/T P–6REAgYïSN„v¢‹USKbpeÿ2–bkòvîvNUS

1uŽN{°‹,g\.•Øv_/T
N¹e¿O HQûm R†N$N*N{°‹,g
N(u„vNUS	c.• buyUS p.•óS¹,{ŒN*N.• sellUSL.•óS¹,{ŒN*N.• Ctrl+Alt+ } _/T 2018.01.11

îO9e†N•ÓNë_wc.• bcb†NShift+\.•Øv0 Tab+;N.•Øv0 EAЏLˆ;`_sQ4NöesQí•

žX R†NN›NŸRý€„vë_wc_sQ Tab+;N.•Øv1~6 R¿~ŒTš[öehV„vN›Në_wc_sQ 2017.11.10

žX R†NR¿~cUS!j_ æ‰ÊS¿~_ËYcUS

žX R†NtepeMO¾‹nbkÈvbk_c V/A+T/F 2017.11.10

žX R†NïSåNup;m¾‹nOPûyϑ„v	c.• ¹eT.•„v 
N.•ŒTN.•  z^O°‹U_
N.•b€N.•	cN„v!kpe cUSMRïSåNHQ	càQ!k z^O9hnc`O	cN„v!kpeZPôf'Y„vOPûy 2017.10.31

žX:_†NtepeMOcUS!jWW„vý€›R ïSåNÐcMR	càQ!kT.•ۏLˆôfup;môf'Y„vOPûy 2017.10.29

žX R†NRybs^ÓN„vhQ@\ØSϑ¾‹n :N†N‚‚¦~5u'`ý€(WN*NMT4-NøvT'^ù[ïSåNЏLˆY*NEAoR,g FOEAꁨRYt¢‹US„vŸRý€êSý€(WvQ-NN*NoR,g-NO(u 2017.10.18

žX R
NT„v\pe¹pMOpeÿO(u
NT„vbkÈvbk_c €NÂSpe
NOQàV:N͑°e R}€"N1Y†N 2017.10.16

R¿~s^ÓN„vãNx̑	g^—g&^s^ÓN z˜Kbtet†NNN ㉳Q†N€ãNxÐc:yf‹JT„v˜ 2017.10.12

teSOŠbR¿~s^ÓN„vãNxûy
i0R†NEA-Nÿ1uŽNãNxÔkƒ
YBgÿ€N™Q„vÔkƒéeÿ	gˆ_Y
N|Q¹[„v0W¹eÿåNTbObaba9e„v°s(WýBl„v/fý€(u1\}YÿÈTÈT 2017.10.07

ûm RN.•s^buyUS N.•s^sellUS 2017.10.02

ûm R¢[7bïzhQ@\ØSϑ åN”^ù[͑°e R}EAöeKNMRîO9e„vÂSpe"N1Y˜ åNTOûm RôfY„vÂSpe:N¢[7bïzhQ@\ØSϑ 2017.09.30

,{N!kЏLˆEAöe‰BlîO9eTêñ]„vhQ@\؞¤‹NUSKbpe îO9eT ÂSpe
NOQ"N1Y†N

îO9e¥c×SBUG„v®±{ÿýVY„v®±{1uŽNýV…Q;`@bhTåw„vŸSàV6eÑS
N3zš[

ûm R؞¤‹NUSϑ ÛV ”N mQ 
P„vNUSë_wc.• Ctrl+\.•Øv9,8,7b6,5,4

V1.3

ŒteO\U^Ðc:y„v¹e_ŒTMOn 2017.08.18

žX Rš[öehV5 6ÿ¡‹—{
NT„vK¿~š[öebkÈvbk_c 2017.05.25

žX RtepeMOybϑcUS“bÞV¤d

žX Rzfý€¡‹—{gя„vgNOgؚ¹påNeâl£QY~vRÔkMOcUS 2017.02.17

ë_wc.•
NY(u /T(uVŒTAãNÿfBŒTShˆ:y buyUSŒTsellUS åNibEQë_wc.•0

žX Rë_¾‹nbkÈvbk_cŒTë_¾‹ncUSë_wc.•

ck_/T(uš[öehVŸRý€ÿYt€{US„vzfý€bkÈvbk_c

îO9e•^B\ãNxÿ ReQèRꁚ[INýQpeÿ:NåNTûm RꁨRbkÈvbk_cꁨR RÓNꁨRÏQÓNŸRý€ZPÆQY 2017.01.20

V1.2

žX Rybϑûy¨RS_MRbkÈvbk_c„vë_wc.• 2017.01.12

OS†NèRãNxŒT¾‹n0

žX R†N'Yϑ„vë_wc.•ÿ;N‰Æ–-N(WbkÈvbk_cŒTcUS
NÿýÆ–-N(WŒÕ‹!jWWÿT(Wë_„vLˆÅ`-NeQ:WŒTúQ:WÿýUS02016.11.29

V1.1

îO
Y†NèRom

žX R.•ØvNUS!j_ÿO(u†NOnChartEvent()ýQpeÿƒ[ŒT,gg'Y„v:S+R1\/fƒ[O°‹Në_wc.•	cN„v!kpeÿꁨR͑
Y„vgbLˆÿ‚Yœgó`s^àQUSÿ€
N/fhQ萢‹US

¨`ïSåNë_„v	càQNs^NUS„vë_wc.•ÿ€
N(uÅbÃ_	g¡l	ggbLˆÿƒ[ONôvgbLˆŒ[:Nbk„vÿ@båNNUS„vöePNš[‰\Ã_ÿ
N‰	c•!kpe†NæT0

ë_wc.•ïSåNꁚ[IN ÷‹HQSb_ KmՋ.•Øv	c®”¶r`„vMO©cx„vW[&{2N<P „v_sQÿ6qT	cN`Oó`O(u„vë_wc.•ÿ·ƒÖS„vsparampe<P(WEA„vž[öeåe×_
N0

Ä~T.•Ctrl+Alt+W[ÍkbpeW[_N	gêñ]„vsparam„v<Pÿ@båN_NïSåNO(uÄ~T.•0

žX RN.•¾‹nÝO,g0

žX RN.••ÓN0

žX RN.•ybϑ_ÍSTUS•ÓNêS	gTTUSöeO(uÿO(uô‹f(WNb—„vꁚ[INfanxiangsuodanýQpȇÿÅ_wÿ

žX RybϑcUSÿ;N‰(uŽNýLˆÅ`ÿz4xLˆÅ`öeO(u0

žX RybϑîO9ebkÈvbk_c¹ppebôv¥c“eQ÷NMO,,{ŒN!kO(uöeKNMR¾‹n„vÂSpe؏(Wÿ°‹—_HQnö–0

žX Rybϑzfý€¾‹nbk_cbkÈvÿO(uöeÿHQ¾‹nÂSpeÿ,{ŒN!kO(uöeKNMR¾‹n„vÂSpe؏(Wÿ°‹—_HQnö–0

žX Rë_s^NUS!j_ÿïSåN	cöeô•HQTb€÷N<hؚNO	éb 2016.07.26

žX R¢‹USáOo`>f:y 2016.07.28

 ReQN›Níw¿~ZPUSöeO(u„vë_wc.•ÿ(WŒÕ‹!jWWÿck(WŒ[„U-N000 2016.09.08

ë_îO9eEAÂSpeöeÿïSåNO(u F7 ë_wc.•0

V1.0

¡‹öehVs^ÓN!j_

¾‹š[Y\ÒyЏLˆN!ks^ÓNãNx LˆÅ`âl¨R'Yöeÿ
N£HNŏ„vs^ÓNÿý€—_0RôfY„v)R¦mÿS_6q	g—_Å_	g1Yÿ

‚YœgÞV¤dǏŽNŏ,_NïSý€O	g0R¾Rybs^ÓN¹pMO¡ls^‰c„vÅ`µQ0

Ticks^ÓN!j_

Ïk*N¥b÷NýOЏLˆN!ks^ÓNãNxÿ0R¾Rybs^ÓN¹pMOöeÿúW,gýý€s^‰cèRÓNMO0

minTP Rybs^ÓNUSP[KNô•„vg\ô•ݍÿ‚Yœg(WLˆÅ`âl¨R
NgRÈp„vöePúQ°sN!k(Wˆ_я„vMOns^‰c$NUSÿُ/fàV:N(Ws^ÓN„vöePs^ðSÑn¹p b„vÿïSåN
z®_Œ'Yُ*NminTP<P

R¥cæ‰mql4
NENÿ	gˆ_Y0W¹eý
NÂaÿêSý€NübkQÑQÈTÿ‚Yœg¨`ù[ُ*N\EA	gôf}Y„vîO9eŒTú^®‹ÿ÷‹Ù~b®öNÑS*NoR,gÈTxyz0217@qq.com 0

,gEAÂS€†N ꁨRbk_c0bkÈv0Èv)RTûy¨Rbk_c0RybúQ:W.mq4  a"ŒŸS\O€ ™Ÿ·_€–€ 0

*/

extern bool EAswitch=true;//EAЏLˆ;`_sQ EA
NꁨRYt¢‹US ë_wc.•ïSåN(u Tab+0 4NöesQí• 	c$N!k Reks^ÓNsQí•

extern string  reminder39="Shift+G s^cUS N.••ÓN Shift+\.•Øv0 æ‹Æ~ë_wc.•÷‹wQØv-N„vŸRý€ô‹f‡ech";//\.•Øv9_YUS6_zzUS s^gяN„vNUS PageDown.• hQs^ Ctrl+Alt+P.•

extern string  reminder34="Tab+3~6 š[öehV Tab+7 R¿~s^ÓN Tab+8 ^—g&^s^ÓN 1,2,7’N¥e 1ŒT2N!k	gHe";//EAèRŸRý€ë_wc_sQ Tab+;N.•Øv0 4NöesQí•EA Tab+1 R¿~cUS Tab+2 R¿~_ÓN

extern string  reminder36="P+L buystop L+L sellstop åNR¿~:NúWÆQybϑbkÈvbk_cB/S+O/K N!k	gHe";//Tab+1R¿~cUS_sQ ؞¤‹æ‰ÊS¿~_ËYcUS ôv¥cc O+L buylimit K+L selllimit

extern string EAôf°eQ@W(Wæ]
N҉„vsQŽN̑÷‹ÊSöeôf°eg°eHr,g0؞¤‹Kbpe„vŒte(WgNb—="¢[7bïzhQ@\ýQpe¾‹n (WgNb— îO9ȇb—„vÂSpeT
NOQàV:N­e5u{k:gb€Í‘°e R}EA€"N1Y†N";//

extern string reminder10="ŒÕ‹!jWW 	g…_Œ[„U (ŒNaO(u ë_wcNUS„v	c.•/f\.•ØvpeW[US.• \Ã_
N‰ï‹	c†N ";//ÂSpeÅ_{˜¾‹nbTêñ]„v Hr,g1.4 ãNxombú^®‹÷‹ÑS®öN xyz0217@qq.com

extern string reminder32="cUSbbkÈvbk_cMRïSåNHQ	càQ!k z^O9hnc`O	cN„v!kpeZPôf'Y„vOPûy ";//ïSåNup;m¾‹nOPûyϑ„v	c.• ¹eT.•„v 
N.•ŒTN.• ؞¤‹	cN!kOPûy20

extern string reminder20="tepeMOybϑcUS“bÞV¤d O+t buylimit K+t selllimit tepeMO¾‹nbkÈvbk_c V/A+T/F";//¡‹—{gя„vgNOgؚ¹påNeâl£QY~vRÔkMOcUS O+f buylimit K+f selllimit

extern string reminder22="Buylimit O+ Buystop P+ Selllimit K+ Sellstop L+ \.•Øv0,1,2,3";// ë_wcݍS_MR÷NY\¹pcUS zfý€cUSG+t/p G+s/l zfý€bkÈvbk_cb/s+j/ibb/s+u/h

extern string reminder23="Buylimit O+ Buystop P+ Selllimit K+ Sellstop L+ \.•Øv4,5,7,8";//¡‹—{gяY\K¿~„vgؚ¹pŒTgNO¹pcUS 	g˜÷‹HQwNEA„våe×_ Tab+;N.•Øv1~9-0ë_wc_sQ

extern string reminder24="Shift+T/P Buylimit Buystop Shift+S/L Selllimit Sellstop  Shift+G ybϑs^cUS";//ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcUS ÂSpe¾‹n(WNb—

extern int piliangtpdianshu=5;//åNGW/°s÷NúW@xybϑ¾‹nbkÈv„vúWpe  b/s+p/l+;N.•Øv0-9GW÷N

extern int piliangsldianshu=5;//åNGW/°s÷NúW@xybϑ¾‹nbk_c„vúWpe  b/s+o/k+;N.•Øv0-9°s÷N

extern int piliangtpjianju=2;//åNGW/°s÷NúW@xybϑ¾‹nbkÈvô•ݍ zfý€bkÈvbk_c ß~N÷NMObkÈvbk_cv/a+i/j

extern int piliangsljianju=3;//åNGW/°s÷NúW@xybϑ¾‹nbk_cô•ݍ ¡‹—{Ó~œg„vúW@x
NQÏQ»SY\¹pbkÈvbk_cv/a+u/h

extern int moveSTTP=50;//'}%`ybϑ
NûybNûybkÈvbk_cݍS_MRY\*N¹p b/s+bkÈvy/g bk_ct/f

extern string reminder27="=== š[öehV!jWW š[öeꁨRûy¨RbkÈvbk_c ýUSN(u ===";//N,‚(WNRŸ”b”NRŸ”
N(u

extern bool timeGMTYesNo3=false;//š[öehV3_sQ š[öeybϑzfý€ûy¨Rbk_cMO NRŸ”
N(u  =========

extern int timeGMTSeconds3=60;//š[öehV3 Y\ÒyЏLˆN!k

extern bool buytrue03=true;//š[öehV3 tureêSYtYUS falseêSYtzzUS

extern bool timeGMTYesNo4=false;//š[öehV4_sQ š[öeybϑzfý€ûy¨RbkÈvMO NRŸ”
N(u

extern int timeGMTSeconds4=60;//š[öehV4 Y\ÒyЏLˆN!k

extern bool buytrue04=true;//š[öehV4 tureêSYtYUS falseêSYtzzUS

extern bool timeGMTYesNo5=false;//š[öehV5_sQ š[öeybϑzfý€ûy¨Rbk_cMO ”NRŸ”
N(u  =========

extern int timeGMTSeconds5=300;//š[öehV5 Y\ÒyЏLˆN!k

extern bool buytrue05=true;//š[öehV5 tureêSYtYUS falseêSYtzzUS

extern bool timeGMTYesNo6=false;//š[öehV6_sQ š[öeybϑzfý€ûy¨RbkÈvMO ”NRŸ”
N(u

extern int timeGMTSeconds6=300;//š[öehV6 Y\ÒyЏLˆN!k

extern bool buytrue06=true;//š[öehV6 tureêSYtYUS falseêSYtzzUS

extern string reminder28="ë_wcbkÈvbk_cݍ»yS_MR÷N„v¹ppe ‚YÂSpe\ŽNs^ðS\Pbk4ls^MOôv¥c(W4ls^MO¾‹n ===";//‚Yœg/fV/A+\.•ØvpeW[âe	cGW÷NúW@x¡‹—{

extern double zhinengSLTP1=40;//—‰ûy¨R„v¹ppe

extern int zhinengSLTP2=80;//ë_wcbk_cbbs+\.•Øv1,4,7 ÌS
P؞¤‹¹ppeë_wcbk_cbbs+\.•Øv3,6,9

extern int zhinengSLTP3=120;//ë_wcbkÈvbbs+\.•Øv,2,5,8 ‚Yœg/fV/A+\.•ØvpeW[âe	cGW÷NúW@x¡‹—{

extern int zhinengSLTPjianju=1;//bkÈvbk_cô•ݍ

extern int zhinengSLTPjuxianjia=20;//ÝO¤bªc½e ݍ°s÷N„vg\bkÈvbk_cݍ»y

extern int zhinengSLTPdingdangeshu=10;//êSYtgяN„vY\US

extern string reminder17="=== ë_ybϑzfý€¾‹nß~NbkÈvbk_cMO ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int timeframe06=0;//þVhˆöeô•hTg v/a+i/j bk_c/f¡‹—{Ó~œgQžX RÌS
P¹pî]„vMOn

extern int bars06=13;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg

extern int beginbar06=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int jianju06=0;//bk_cbkÈvô•ݍ

extern int juxianjia06=10;//ÝO¤bªc½e ݍ°s÷N„vg\bkbbk_cݍ»y

extern int dingdangeshu06=100;//êSYtgяN„vY\US

extern int pianyiliang06=50;//bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int pianyiliang06tp=15;//bkb(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹pzfý€¾‹nß~NbkÈvMO

extern int selltp06=20;//sellUSbkÈv R¹pî]„vúW@x
NQ
NûyY\¹p 2–bks^ðSv`aib'Y¹pî]€àeÕlbkÈv

extern string reminder16="=== ë_ybϑzfý€¡‹—{(WÓ~œg„vúW@x
NÏQ»S¹pî]QÏQ»SY\¹pbkÈvbk_c ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int timeframe05=0;//þVhˆöeô•hTg v/a+u/h

extern int bars05=13;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg

extern int beginbar05=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int jianju05=3;//bk_cbkÈvô•ݍ

extern int juxianjia05=30;//ÝO¤bªc½e ݍ°s÷N„vg\bkbÝ»y

extern int dingdangeshu05=300;//êSYtgяN„vY\US

extern int pianyiliang05=80;//bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int pianyiliang05tp=20;//bkb(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern string reminder12="=== ë_zfý€¾‹nbkÈvbk_cÂSpeíw¿~ýUSN(u ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int timeframe10=0;//þVhˆöeô•hTg  bk_c/f¡‹—{Ó~œgQžX RÌS
P¹pî]„vMOn

extern int bars10=13;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg B/S+I/J

extern int bars1010=7;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg B/S+U/H ¡‹—{K¿~pe
NT

extern int beginbar10=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int jianju10=3;//bk_cô•ݍ Tab+Q ûy¨RbkÈvbk_c0R5000¹p
N ØSøvÖSˆm

extern int jianju10tp=2;//bkÈvô•ݍ

extern int juxianjia10=20;//ÝO¤bªc½e ݍ°s÷N„vg\bkbbk_cݍ»y

extern int dingdangeshu10=100;//êSYtgяN„vY\US

extern int pianyiliang10=50;//bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int pianyiliang10nom=50;//bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p N/D+\.•ØvpeW[ ë_wczfý€bk_c

extern int dingdangeshu10nom=5;//ë_wc êSYtgяN„vY\US N/D+\.•ØvpeW[ ë_wczfý€bk_c

extern int pianyiliang10tp=20;//bkb(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int selltp10=20;//sellUSbkÈv R¹pî]„vúW@x
NQ
NûyY\¹p 2–bks^ðSv`aib'Y¹pî]€àeÕlbkÈv

extern string reminder15="=== ë_wcݍS_MR÷Nb¡‹—{gяY\K¿~„vgؚ¹pŒTgNO¹pcUS ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int Guadanprice=10;//ë_wcݍS_MR÷NY\¹pcUS S_cUSݍ»y°s÷NNOŽN\Pbk4ls^MOöeåN\Pbk4ls^MOcUS

extern int Guadanprice1=40;//Buylimit o+ Buystop p+

extern int Guadanprice2=60;//Selllimit k+ Sellstop l+

extern int Guadanprice3=80;//  +\.•Øv0,1,2,3

extern int Guadanprice4=14;//ë_wc¡‹—{gяY\K¿~„vgؚ¹pŒTgNO¹pcUS

extern int Guadanprice5=5;//Buylimit o+ Buystop p+

extern int Guadanprice7=17;//Selllimit k+ Sellstop l+

extern int Guadanprice8=8;//   +\.•Øv4,5,7,8 R+Rù[”^¾‹n„vK¿~

extern int Guadanbuylimitpianyiliang=40;// Buylimit(W¡‹—{Ó~œg„vúW@x
N 
NûyY\¹p

extern int Guadanselllimitpianyiliang=30;//Selllimit(W¡‹—{Ó~œg„vúW@x
N NûyY\¹p

extern int Guadandianchabeishu=2;//cBuystopŒTSellstopöeOPûyY\
P¹pî]åN2–GPz4x

extern double Guadanlots=0.3;//cUSKbpe

extern int Guadangeshu=5;//cUS*Npe

extern int Guadanjianju=3;//cUSô•ݍ

extern int Guadanjuxianjia=15;//ÝOi–ªc½e ݍ°s÷NcUS„vg\¹ppe

extern double Guadansl=0.0;//cUSbk_c¹ppe 0
N¾‹bk_c

extern double Guadantp=0.0;//cUSbkÈv¹ppe 0
N¾‹bkÈv

extern string  comment1="=== ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcUS ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int Guadanprice41=11;//ë_wc¡‹—{gяY\K¿~„vgؚ¹pŒTgNO¹pcUS

extern int Guadanbuylimitpianyiliang1=20;//Buylimit(W¡‹—{Ó~œg„vúW@x
N 
NûyY\¹p

extern int Guadanselllimitpianyiliang1=10;//Selllimit(W¡‹—{Ó~œg„vúW@x
N NûyY\¹p

extern int Guadandianchabeishubuylimit1=2;//cBuylimit T
NOPûyY\
P¹pî]åN2–c
N
N

extern int Guadandianchabeishuselllimit1=2;//cSelllimt TNOPûyY\
P¹pî]åN2–c
N
N

extern int Guadandianchabeishu1=2;//cBuystopŒTSellstopöeOPûyY\
P¹pî]åN2–GPz4x

extern double Guadanlots1=0.2;//cUSKbpe cUSMRïSåNHQ	càQ!kT.• z^O9hnc`O	cN„v!kpeZPôf'Y„vOPûy

extern int Guadangeshu1=5;//cUS*Npe Shift+T/P Buylimit Buystop Shift+S/L Selllimit Sellstop

extern int Guadanjianju1=3;//cUSô•ݍ Shift+G ybϑs^cUS

extern int Guadanjuxianjia1=15;//ÝOi–ªc½e ݍ°s÷NcUS„vg\¹ppe

extern double Guadansl1=0.0;//cUSbk_c¹ppe 0
N¾‹bk_c 	cN!kT.•OPûy„v؞¤‹<P/f20*NúW¹p

extern double Guadantp1=0.0;//cUSbkÈv¹ppe 0
N¾‹bkÈv

extern string reminder11="=== zfý€cUSÂSpe¾‹níw¿~ýUSN(u ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int zhinengguadanjuxianjia=20;//cUSݍS_MR÷Ng\ݍ»y zfý€cUSG+t buylimit G+s selllimit

extern int zhinenga=13;//ÖSgя„vY\9hK¿~¡‹—{ G+p buystop G+l sellstop

extern double zhinengguadanlots=0.2;//cUSKbpe

extern int zhinengguadangeshu=5;//cUS*Npe

extern int zhinengguadanjianju=3;//cUSô•ݍ

extern int zhinengguadanSL=0;//cUSbk_cÿ0sS:N
N¾‹n

extern int zhinengguadanTP=0;//cUSbkÈvÿ0sS:N
N¾‹n

extern int zhinengguadanslippage=5;//cUSÑn¹ppe

extern int zhinengb=0;//ÎN,{àQ9hk¿~_ËY¡‹—{ÿ؞¤‹S_MRK¿~

extern int zhinengtimeframe=0;//K¿~„vöeô•hTgÿ؞¤‹S_MRþVhˆöeô•hTg

extern int zhinengguadanzengjiabuy=30;//
NûyàQ*N¹p_ËYcbuylimitUS ïSåN/fpe

extern int zhinengguadanzengjiasell=15;//NûyàQ*N¹p_ËYcselllimitUS ïSåN/fpe

extern int zhinengguadanzengjiabuystop=30;//
NûyàQ*N¹p_ËYcbuystopUS ïSåN/fpe

extern int zhinengguadanzengjiasellstop=15;//NûyàQ*N¹p_ËYcsellstopUS ïSåN/fpe

extern string reminder19="=== ¡‹—{gя„vgNOgؚ¹påNeâl£QY~vRÔkMOcUS ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int timeframe07=0;//þVhˆöeô•hTg peϑY„vK¿~¡‹—{ÂSpe

extern int bars07=31;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg O+f buylimit K+f selllimit

extern int beginbar07=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int timeframe08=0;//þVhˆöeô•hTg  peϑ\„vK¿~¡‹—{ÂSpe    ====

extern int bars08=11;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg eâl£QY—‰$N*N¹pR¿~ ُ*N!jWW1\/f~b0Rُ$N*N¹p

extern int beginbar08=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern string reminder18="=== eâl£QY~vRÔkcUSÂSpe ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int fibhulue6=6;//ý_eu6¾‹n ý_euN*N~vRÔkMOncUS 0123456ù[”^-23.6%--76.4%  peW[8:N
Ný_eu

extern int fibhulue5=5;// 0,1,2,3,4,5,6R+Rù[”^-23.6% 0% 23.6% 38.2% 50% 61.8% 76.4% peW[8:N
Ný_eu

extern int fibhulue4=8;//ý_eu4¾‹n50% kXøvù[”^„vý_eupeW[sS:N
N(Wُ*N~vRÔkMOcUS

extern int fibhulue3=8;//ý_eu3¾‹n38.2% ‹O‚YkX8:N
Ný_eu38.2% kX3:Ný_euُ*NMOn

extern int fibhulue2=8;//ý_eu2¾‹n23.6%   O+f buylimit K+f selllimit

extern int fibhulue1=8;//ý_eu1¾‹n0%

extern int fibhulue0=8;//ý_eu0¾‹n -23.6%MOn&^bk_ccUS ù[ØNN›NGPz4xLˆÅ`

extern int fibGuadansl1=100;//-23.6%MOncUSbk_c¹ppe 0
N¾‹bk_c =\ϑ¾‹n
Nbk_c åN2–wz4x

extern int fibbuypianyiliang=-15;//buylimitOPûyϑ (W¡‹—{Ó~œg„vúW@x
NteSO
NûybNûyY\¹p

extern int fibsellpianyiliang=5;//sellimitOPûyϑ (W¡‹—{Ó~œg„vúW@x
NteSO
NûybNûyY\¹p

extern double fibGuadanlots=0.2;//cUSKbpe

extern int fibGuadangeshu=1;//_ËYöecUS*Npe  ÏkžX RN*N~vRÔkMOncUSpe RN

extern int fibGuadanjianju=3;//cUSô•ݍ

extern int fibGuadanjuxianjia=20;//ÝOi–ªc½e ݍ°s÷NcUS„vg\¹ppe

extern int fibGuadansl=0;//cUSbk_c¹ppe 0
N¾‹bk_c

extern int fibGuadantp=0;//cUSbkÈv¹ppe 0
N¾‹bkÈv

extern string reminder21="=== tepeMOybϑcUS“bÞV¤d ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int tenweishu=5;//¥b÷NÎNæ]0RóSS+TtepeèR(\pe¹p_N—{NMO)*bÖS„v„vMOpe KNT„vý_eu

extern double tenmax=30;//S_¹pî]Ǐ'Yöe buylimitUS(W¡‹—{Ó~œg
N R
Nُ*N¹ppe 
NQÂS€¹pî]

extern double tenGuadanlots=0.3;//cUSKbpe ‚Yœgselllimitc„v÷NMOOPî]ˆ_'Y ÷‹Œte
Nb—*bÖS„vMOpe

extern int tenGuadangeshu=5;//cUS*Npe O+t buylimit K+t selllimit

extern int tenGuadanjianju=3;//cUSô•ݍ

extern int tenbuypianyiliang=30;//buylimitOPûyϑ (W¡‹—{Ó~œg„vúW@x
NteSO
NûyY\¹p

extern int tensellpianyiliang=25;//selllimitOPûyϑ (W¡‹—{Ó~œg„vúW@x
NteSONûyY\¹p

extern int tenGuadanjuxianjia=20;//ÝOi–ªc½e ݍ°s÷NcUS„vg\¹ppe

extern double tenGuadansl=0;//cUSbk_c¹ppe 0
N¾‹bk_c

extern double tenGuadantp=0;//cUSbkÈv¹ppe 0
N¾‹bkÈv

extern string reminder31="=== tepeMOzfý€¡‹—{TybϑbkÈvbk_c ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int tensltpweishu=5;//¥b÷NÎNæ]0RóSS+TtepeèR(\pe¹p_N—{NMO)*bÖS„v„vMOpe KNT„vý_eu

extern double tensltpmax=30;//S_¹pî]Ǐ'Yöe (W¡‹—{Ó~œg
N R
Nُ*N¹ppe 
NQÂS€¹pî]

extern int tensltppianyiliang=25;//bk_cOPûyϑ V/A+T/F

extern int tentppianyiliang=25;//bkÈvOPûyϑ

extern int tensltpjianju=3;//ô•ݍ

extern int tensltpjuxianjia=15;//ÝOi–ªc½e ݍ°s÷NcUS„vg\¹ppe

extern int tensltpdingdangeshu=10;//Yt„v¢‹USpe

extern string reminder05="=== ybϑzfý€¾‹nbkÈvbk_cÂSpe¾‹n ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int a=13;//ÖSgя„vY\9hK¿~¡‹—{bk_cgNOgؚ<P

extern int b=0;//ÎN,{àQ9hk¿~_ËY¡‹—{ÿ؞¤‹S_MRK¿~

extern int timeframe=0;//K¿~„vöeô•hTgÿ؞¤‹S_MRþVhˆöeô•hTg

extern int c=5;//bk_cô•ݍ

extern int e=30;//ݍ»y°s÷N„vg\bk_cbkÈv¹ppe

extern int d=10;//(W¡‹—{Ó~œg„vúW@x
NžX RàQ*N¹pÿïSåN/ftepe

extern double SL=0.0;//bôv¥c“eQbk_c÷N<h,÷N<hOHQ

extern double TP=0.0;//bôv¥c“eQbkÈv÷N<hÿN!k(uöe°‹—_nö–

extern string reminder13="=== š[öehV3ÂSpe š[öeybϑzfý€ûy¨Rbk_cMO ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int timeframe03=0;//þVhˆöeô•hTg

extern int bars03=11;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg

extern int beginbar03=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int jianju03=3;//bk_cô•ݍ

extern int juxianjia03=30;//ÝO¤bªc½e ݍ°s÷N„vg\bk_cݍ»y

extern int pianyiliang03=50;//bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int dingdangeshu03=10;//êSYtgяN„vY\US

extern string reminder14="=== š[öehV4ÂSpe š[öeybϑzfý€ûy¨RbkÈvMO ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int timeframe04=0;//þVhˆöeô•hTg

extern int bars04=11;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg

extern int beginbar04=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int jianju04=3;//bkbô•ݍ

extern int juxianjia04=15;//ÝO¤bªc½e ݍ°s÷N„vg\bkbÝ»y

extern int pianyiliang04tp=20;//bkb(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int dingdangeshu04=10;//êSYtgяN„vY\US

extern string reminder25="=== š[öehV5ÂSpe š[öeybϑzfý€ûy¨Rbk_cMO ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int dingshitimeframe05=0;//þVhˆöeô•hTg

extern int dingshibars05=7;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg

extern int dingshibeginbar05=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int dingshijianju05=3;//bk_cô•ݍ

extern int dingshijuxianjia05=30;//ÝO¤bªc½e ݍ°s÷N„vg\bk_cݍ»y

extern int dingshipianyiliang05=50;//bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int dingshidingdangeshu05=10;//êSYtgяN„vY\US

extern string reminder26="=== š[öehV6ÂSpe š[öeybϑzfý€ûy¨RbkÈvMO ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int dingshitimeframe06=0;//þVhˆöeô•hTg

extern int dingshibars06=7;//ÖSþVhˆY\9hk¿~¡‹—{Ó~œg

extern int dingshibeginbar06=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int dingshijianju06=3;//bkbô•ݍ

extern int dingshijuxianjia06=15;//ÝO¤bªc½e ݍ°s÷N„vg\bkbÝ»y

extern int dingshipianyiliang06tp=20;//bkb(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int dingshidingdangeshu06=10;//êSYtgяN„vY\US

extern string reminder03=" ===  .•ØvNUSÂSpe¾‹n  === ";//

extern bool keycode=true;//.•ØvNUS؞¤‹_/T

extern int buykey=73;//pNUS	c.• ؞¤‹\.•ØvpeW[.• 9 

extern int sellkey=77;//VSUS	c.• ؞¤‹\.•ØvpeW[.• 6 

extern int buykeydouble=72;//pNUS	c.• ÌS
P؞¤‹Kbpe \.•ØvpeW[.• 8 

extern int sellkeydouble=76;//VSUS	c.• ÌS
P؞¤‹Kbpe \.•ØvpeW[.• 5 

extern int buykey3=71;//pNUS	c.• 	N
P؞¤‹Kbpe \.•ØvpeW[.• 7 

extern int sellkey3=75;//VSUS	c.• 	N
P؞¤‹Kbpe\.•ØvpeW[.• 4 

extern int holdingtimemin=180;//NUSMR	cNNShift&^bk_cNUS	cNNÝOcY\Òy…Q	gHe íwöeô•

extern int holdingtimemax=1800;//NUSMR	cNNShift&^bk_cNUS •öeô•	gHe \.•Øv \pe¹pRbc

extern int zuidaclose=338;//s^÷N<hgؚ„vNUSÿ؞¤‹ Insert .•

extern int zuixiaoclose=339;//s^÷N<hgNO„vNUSÿ؞¤‹ Delete .•

extern int zuizaoclose=335;//s^géeN„vNUSÿ؞¤‹ End .•

extern int zuijinclose=337;//s^gяN„vNUSÿ؞¤‹ PageDown .•

extern int yijianPingcang=8217;//N.•s^ÓNÿ؞¤‹Ctrl+Alt+ P .•

extern int yijianPingbuydan=8240;//N.•s^buyUSÿ؞¤‹Ctrl+Alt+ B .•

extern int yijianPingselldan=8223;//N.•s^sellUSÿ؞¤‹Ctrl+Alt+ S .•

extern int baobenSL=8230;//ybϑ¾‹nbk_cMO(WÝO,g¿~
N,Ctrl+Alt+ L .• ؞¤‹YtYzzUS

extern int baobenTP=8212;//ybϑ¾‹nbkÈvMO(WÝO,g¿~
N,Ctrl+Alt+ T .• ‚YœgÐcMR	c†NB/SêSYtN¹

extern int piliangSLTP=1;//Tab+Esc ûy¨RbkÈvbk_c0R5000¹p
N ØSøvÖSˆm ÅN”^%`O(u

//extern int zhinengSL=31;//ybϑzfý€¾‹nbk_c ؞¤‹Tab+ S .•

//extern int zhinengTP=20;//ybϑzfý€¾‹nbkÈv ؞¤‹Tab+ T .•

extern int suoCang=82;//N.••ÓNÿShift+\.•ØvpeW[.• 0  b/s+;N.•ØvpeW[0 ÖSˆmbkÈvbk_c

extern int fanxiangSuodan=82;//ybϑ_ÍSTUS•ÓNêS	gTTUSöeO(uÿCtrl+\.•ØvpeW[.• 0 

extern int timeframe09=0;//þVhˆöeô•hTg    &^bk_cNUS¾‹n                       ====

extern int beginbar09=0;//0ÎNS_MRK¿~_ËY 51\/fݍS_MRK¿~€_æ]59hK¿~ý_eu
N¡‹

extern int bars097=7;//°s÷NpNNUS6qTÖSgяY\9hk¿~¡‹—{gNO÷NÏQ»S¹pî]QÏQ»SOPûyϑ„v÷NMO¾‹nbk_c

extern int buypianyiliang=50;//buyUSOPûyϑ bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p

extern int sellpianyiliang=50;//sellUSOPûyϑ bk_c(W¡‹—{Ó~œg„vúW@x
N
NûybNûyàQ*N¹p  ====

extern int buypianyiliang9=30;//\OPûyϑ Ctrl+Alt+\.•Øv"9" buyUS&^bk_c ù[”^K¿~7 $N
P¹pî]OPûy

extern int sellpianyiliang6=30;//\OPûyϑ Ctrl+Alt+\.•Øv"6" sellUS&^bk_c ë_&^bk_cýUS ‚YœgÍSTôv¥cbk_cúQeg

extern int bars096=4;//\OPûyϑ O(u„vÖSgяY\9hk¿~¡‹—{gNO÷NÏQ»S¹pî]QÏQ»SOPûyϑ„v÷NMO¾‹nbk_c

extern double keylots=0.3;//.•ØvNUSKbpe

extern int keyslippage=20;//.•ØvNUS!j_Ñn¹ppe

extern string reminder01="=== bkÈvbk_cûy¨Rbk_cÂSpe¾‹n ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern bool autosttp=true;//bkÈvbk_cûy¨Rbk_c;`_sQ ؞¤‹:N¡‹öehV!j_ЏLˆ

extern bool timeGMTYesNo1=true;//ꁨRbkÈvbk_cûy¨Rbk_c š[öehV_sQ

extern int timeGMTSeconds1=100;//ꁨRbkÈvbk_cûy¨Rbk_cY\ÒyЏLˆN!k

extern bool AutoStoploss=true;//bk_c_sQ

extern double stoploss=320;//bk_c¹ppe

extern bool AutoTakeProfit=true;//bkÈv_sQ

extern double takeprofit=500;//bkÈv¹ppe

extern bool AutoTrailingStop=true;//Èv)RTûy¨Rbk_c_sQ

extern double TrailingStop=340;//ûy¨Rbk_c¹ppe

extern string reminder02="=== I{Ôk‹OReks^ÓNÂSpe¾‹n ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int GraduallyNum=5;//(Wûy¨Rbk_cMOŒTbkÈvMOKNô•RàQ!ks^ÓN bkÈvÏQûy¨Rbk_cTd–åN!kpeI{ŽNs^ÓN„vô•”–

extern int SetTimer=5;//¡‹öehVÒype ¡‹öehV!j_NRybs^ÓNY\ÒyЏLˆN!k

extern int minTP=4;//ŒÕ‹O(u Rybs^ÓNUSP[KNô•„vg\ô•ݍ

extern int slippage=5;//ŒÕ‹O(u Ñn¹ppe

//---- input parameters

extern string reminder30="	gˆ_Y
N|Q¹[„v0W¹eÿåNTbObaba9e„v°s(WýBl„v/fý€(u1\}Y ÈTÈT ";//Nb—/fR¿~s^ÓN¾‹n teSOŠbR¿~s^ÓN„vãNxûy
i0R†NEA-Nÿ1uŽNãNxÔkƒ
YBg €N™Q„vÔkƒée

extern string  ¡{tcÓNUS÷S="*";           // *:NS_MRþVh'^„vhQècÓNUS @b	g¡{t„vcÓNÅ_{˜T¹eT &TR
Nå]\O0

//…Q¹[ïSåN/fN*NbY*NcÓNUS„vIDÿRrR&{–¿OÿàV:Nz^/f$R­eÏk*NcÓNID/f
N/fُ*NØSϑ„vP[2N0@b	g¡{t„vcÓNÅ_{˜T¹eTÿ&TR
Nå]\O0

extern int     ·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN=2;             // ·ƒ)R¹e_ÿ1-6Rš[ÿ2-‹¿R¿~ÿvQƒ[<P-àe·ƒ)Rs^ÓN0

// z^ÎNþV
Nd"}ù[aŒÿïSåN/f‹¿R¿~TrendLine0҉¦^¿~TrendLine By Angel0I{ݍ»yS¿~Equidistant Channel0

extern int     bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c=2;             // bk_c¹e_ÿ1-6Rš[ÿ2-‹¿R¿~ÿ3ûy¨Rbk_c;vQƒ[<P-àebk_cs^ÓN0

extern int bandsA=20;//BandschÂSpe1 öeô•hTg 	éb 16Rš[ öe :N^—g&^s^ÓN!j_

extern int bandsB=0;//BandschÂSpe2 s^ûy ^—g&^O–@w`O	éb„vöeô•hTg9eØS \Ã_EAæ‰ÊS^—g&^ôv¥cs^ÓN†N

extern int bandsC=2;//BandschÂSpe3 OPûy^—g&^„v؞¤‹ÂSpe
NŸq‰`Nš[(ŒNaîO9e ÷‹îO9eNb—„vÂSpe bkÈvs^ÓN؞¤‹OPûy†N$N
P¹pî]Tab+8/T¨R

extern int bandsdianchabeishu=2;//¹pî]OPûy
Ppe OPûy

extern int bandsTPpianyi=10;//bkÈv¿~OPûy¹ppe OPûy

extern int bandsSLpianyi=20;//bk_c¿~OPûy¹ppe OPûy

extern string  ûy¨Rbk_cbk_c¹e_ÂSpe="===ûy¨Rbk_cbk_c¹e_ÂSpe===";

extern double   bk_c=270;

extern double   –™!kÝO¤bÈv)Rbk_c=200;

extern double   ÝO¤bÈv)R = 10;

extern double   ûy¨Rek• = 100;

extern bool    /f&T>f:y:y‹O¿~=true;          // /f&T(WþV-N>f:y·ƒ)Rbk_c÷N<h¿~ÿ¹e¿O‰ß[/f&T¾‹ncknx0

extern color  ·ƒ)R÷N<h:y‹O¿~=C'108,108,0';     // ·ƒ)R÷N<h¿~œ˜r‚

extern color   bk_c÷N<h:y‹O¿~=C'90,0,0';           // bk_c÷N<h¿~œ˜r‚

extern string reminder33="R¿~cUS!jWW æ‰ÊS‹¿R¿~_ËYcUS";//

extern double huaxianguadanlots=0.1;//cUSKbpe

extern int huaxianguadangeshu=3;//cUS*Npe

extern int huaxianguadanjianju=3;//cUSô•ݍ

extern double huaxianguadansl=220;//cUSbk_c

extern double huaxianguadantp=200;//cUSbkÈv

extern double hengxianguadansl=0.0;//*j¿~cUSbk_c *j¿~!j_öeL+G ؞¤‹
N¾‹nbkÈvbk_c

extern double hengxianguadantp=0.0;//*j¿~cUSbkÈv *j¿~!j_öeL+G

extern int jianju07=3;// bk_cô•ݍ R¿~bkÈvbk_cÂSpe¾‹n

extern int jianju07tp=1;// bkÈvô•ݍ R¿~bkÈvbk_cÂSpe¾‹n

extern int pianyiliang07=20;//bk_cOPûy ckpe/fckTOPûy pe/fÍSTOPûy

extern int pianyiliang07tp=20;// bkÈvOPûy

extern int juxianjia07=30;//ݍ°s÷Ng\ݍ»y ÝO¤bªc½e

extern int dingdangeshu07=20;//êSYtgя„vàQ{¢‹US

extern int huaxianguadanjuxianjia=5;//‰[hQªc½e cUSݍ°s÷N

extern string reminder35="R¿~_ÓN!jWW æ‰ÊS‹¿R¿~b*j¿~_ËY_ÓN";//

extern int huaxiankaicanggeshu=3;//_ÓN!kpe vQÖNÂSpeåNEAúW,g_ÓNÂSpe:NÆQ *j¿~!j_L+K

extern int huaxiankaicangtime=1000;//_ÓNô•”– ëkÒy 1Òy=1000ëkÒy êSÂS€öeô• 
N¡{_ÓN÷NMO *j¿~!j_L+K

extern int huaxiankaicanggeshuT=3;//_ÓN!kpe vQÖNÂSpeåNEAúW,g_ÓNÂSpe:NÆQ bk_c¿~bk_cX+L+K

extern int huaxiankaicangtimeT=2000;//_ÓNô•”– ëkÒy 1Òy=1000ëkÒy  bk_c¿~bk_cX+L+K

extern int huaxiankaicanggeshuR=3;//_ÓN!kpe ÂS€*j¿~„vMOnâeÂS€÷N<h  *j¿~ShiftR!j_

extern double timeseconds1P=2;//_ÓNöeô•ô•”– Òy âeÂS€öeô•ÈSÂS€÷N<h *j¿~ShiftR!j_

extern double huaxiankaicanglotsT=0.1;//_ÓNKbpe  *j¿~ShiftR!j_ Š¿~Tô•”–öeô•ޏí~_ÓNôv0R÷N<hԏÞV

extern double huaxianzidongjiacanglots=0.1;// ꁨR RÓN _ÓNKbpe ====== KmՋ”NRŸ”ꁨRýUS

extern int huaxianzidongjiacanggeshu=3;// ꁨR RÓN _ÓN!kpe

extern int huaxianzidongjiacanggeshutime=2;//ꁨR RÓN ûy¨R*j¿~!kpe

extern int linezidongjiacangyidong=30;//ꁨR RÓN ûy¨R*j¿~ Y\*N¹p

extern int linebuyzidongjiacangpianyi=20;//ꁨR RÓN Buy LineOPûy

extern int linesellzidongjiacangpianyi=20;//ꁨR RÓN Sell LineOPûy ======

//extern int linepingcangRTime=1000;//s^ÓNöeô•ô•”– *j¿~!j_ 	cNNóS¹„vShift L+PŠ¿~	cöeô•ô•”–NUSNUSs^ÓN

extern double timeseconds=2;//s^ÓNöeô•ô•”– *j¿~!j_ 	cNNóS¹„vShift L+PŠ¿~	cöeô•ô•”–NUSNUSs^ÓN

extern int linebar=5;//¡‹—{gяY\9hK¿~„vgؚgNO<PRN9h*j¿~ *j¿~!j_

extern double linepianyi=20;//*j¿~!j_NW/SÏk!k
NûybNûyY\úW¹p *j¿~!j_

extern double lineslpianyi=30;//*j¿~!j_ CtrlR+ L+P š[öehV!j_SL ݍ*j¿~OPûyY\¾‹nSL

extern int linekaicangshiftRbars=7;//ShiftR*j¿~&^bk_c_ÓNöe ÖSgяY\9hK¿~¡‹—{gؚgNO¹p

extern double linekaicangshiftRpianyi=100;//ShiftR*j¿~&^bk_c_ÓNöe ¡‹—{Ó~œgTQOPûyY\ ¹pî]ò]Ï~ Rۏ»S†N

extern string reminder37="ꁨRýUSíw¿~ RÓN ë_bkÈvbk_c eR4Y®v!jWW KmՋ-N";//Tab+> YUSeR4Y®v Tab+< zzUSeR4Y®v

extern int SL5mtimeGMTSeconds1=30;//¾‹nbkÈvbk_c„vô•”–öeô•

extern int SL5mlineGraduallyNum=2;//Rybs^ÓN

extern double SL5mlinestoploss=120;//bk_c

extern double SL5mlinetakeprofit=160;//bkÈv

extern double SL5mlineTrailingStop=130;//ûy¨Rbk_c

extern int SL1mlinetimeframe=11;//NRŸ”bk_c*j¿~ ¡‹—{gяY\9hK¿~„vgؚgNO¹p R
NNb—„vOPûy

extern int SL5mlinetimeframe=4;//”NRŸ”bk_c*j¿~ ¡‹—{gяY\9hK¿~„vgؚgNO¹p R
NNb—„vOPûy

extern int SL15mlinetimeframe=3;//AS”NRŸ”bk_c*j¿~ ¡‹—{gяY\9hK¿~„vgؚgNO¹p R
NNb—„vOPûy

extern int SLlinepingcangjishu=3;//æ‰ÊSbk_c¿~s^‰cgяN„vèRÓNMO

extern double SLbuylinepianyi=30;//buyUSbk_cOPûy

extern double SLselllinepianyi=30;//sellUSbk_cOPûy

extern int SLlinepingcangtime=0;//bk_cs^ÓNô•”– ëkÒy

extern int  SL5QTPpingcang=50;//Tab+P GW÷NbkÈv*j¿~

extern int SL1mQlinetimeframe=3;// \.•Øv * .•ybϑNUS ¡‹—{NRŸ”Y\9hK¿~„vgNOgؚ÷N   =====

extern int SLQNum=4;//ybϑNUS*Npe

extern double SLQlots=0.1;//ybϑNUSKbpe æ]¹„v / .•ÌS
P Å_{˜Kb¨R¾‹n ìrËzŽNhQ@\Kbpe

extern int SLQbuylinepianyi=20;//buyUSbk_cOPûy

extern int SLQselllinepianyi=20;//sellUSbk_cOPûy

extern int SL5Qtp=40;// \.•Øv * .• NUS„˜¾‹„vbkÈv¹ppe

extern int  SL5QTPpingcang1=30;// GW÷NbkÈv*j¿~

extern int SLQlinepingcangSleep=1000;// GW÷NbkÈv*j¿~s^ÓNô•”–öeô•

extern int SL5QTPtime=180;// ¡‹pehVÒype ÝO,gs^

extern int SL5QTPtime1=300;//¡‹pehVÒype ôv¥cs^   =====

extern string reminder38="reminder38";//9hncch„vpe<P ꁨRgbLˆ¡‹RûN¡R

extern int  imbfxTmax=95;//MBFXch I+;N.•Øv1/T¨R O(u„vꁚ[INch

extern int  imbfxTmin=5;//MBFXch

extern double  iBSTrendmax=0.1;//BSTrendch I+;N.•Øv2/T¨R KmՋ6–µk

extern double  iBSTrendmin=-0.1;//BSTrendch

extern double linebuypingcangctrlRpianyi=40;//æ‰ÊS*j¿~TݍS_MR÷NY\¾‹nbk_c KmՋ



extern string reminder07="=== hQ@\¾‹n ===";//

extern bool defaultlotstrue=true;///f&T/T(uhQ@\NUSKbpe ؞¤‹/T(u

extern bool Testsparam=false;//ꁚ[INë_wc.• KmՋ	c.•ù[”^„vsparam<PÓ~œg(WEA„våe×_̑

extern bool testtradeSLSP=true;//s^ðS/f&T/ec&^
NbkÈvbk_c_US ؞¤‹/ec ‚YàeÕl_US÷‹9e:Nfalse

extern bool dingdanxianshi=true;//¢‹USáOo`>f:y(WþVhˆ ؞¤‹_/T

extern color dingdanxianshicolor=clrYellow;//¢‹USáOo`>f:yœ˜r‚

extern int dingdanxianshiX=10;//¢‹USáOo`>f:yMOn Xt *jTMOn æ]
NwËYMO

extern int dingdanxianshiY=90;//¢‹USáOo`>f:yMOn Yt µ~TMOn

extern int dingdanxianshiX1=800;//EAÍd\OáOo`>f:yMOn Xt *jTMOn óS
N

extern int dingdanxianshiY1=30;// EAÍd\OáOo`>f:yMOn Yt µ~TMOn

extern int dingdanxianshiX2=800;//EAÍd\OáOo`>f:yMOn Xt *jTMOn óS
N ,{ŒNLˆ

extern int dingdanxianshiY2=60;// EAÍd\OáOo`>f:yMOn Yt µ~TMOn

extern bool timeGMTYesNo2=true;//š[öehV2_sQ åe×_‡eW[Ðc:y

extern int timeGMTSeconds2=15;//\PYuY\Òy žX R†N{°‹,gNUS„v$N*N	c.•buy/sell P/L.•óS¹”–ÁX	c.•

extern int presspianyi=20;//¹eT.•
N.•ŒTN.•	cN!kOPûy„v¹ppe cUSMRïSåNHQ	càQ!k z^O9hnc`O	cN„v!kpeZPôf'Y„vOPûy

extern int pianyiglo=20;//bkÈvbk_chQ@\OPûy„v¹ppe

extern int expirationM=0;//cUS	gHeöeô• RŸ” 08lEN 	g›Ns^ðSÅ_{˜Kb¨RÖSˆmcUS  ===========





extern string reminder29="=== ¢[7bïzhQ@\ýQpe¾‹n êS(W—‰ôf°ehQ@\ýQpeöeO(uN!k ôf°ebŸRT÷‹Í‘°e R}EA ===";//hQ@\ýQpeN„v¾‹n
NOàV:NEA͑°e R} MT4͑/T aY­e5usQ:g€Í‘n¾‹nÂSpe

extern bool globalVariablesDeleteAll=false;// Rd–hQ萄v¢[7bïzhQ@\ýQpe RËYS¢[7bïzhQ@\ýQpe¾‹n

extern bool glolotsture=false;//îO9ehQ@\؞¤‹NUSKbpe_sQ ÷‹9e:NtrueTîO9eNNLˆ„vNUSKbpe ÝOX[sSïS ===

extern double defaultlots=0.1;//hQ@\؞¤‹NUSKbpe OîO9eEA@b	g„vKbpe¾‹š[ ÷‹HQSb_
Nb—„v_sQ

extern bool gloGraduallytrue=false;//îO9eI{Ôk‹OReks^ÓN_sQ ÷‹9e:NtrueTîO9eNNLˆ„vÂSpe ÝOX[sSïS       ===

extern bool Gradually=true;//I{Ôk‹OReks^ÓN ؞¤‹_/T NNLˆïSåNîO9e
NT„vRybs^ÓN!j_

extern bool gloTickmodetrue=false;//îO9eRybs^ÓN!j__sQ ÷‹9e:NtrueTîO9eNb—„vÂSpe ÝOX[sSïS           ===

extern bool Tickmode=false;//Rybs^ÓN!j_؞¤‹false¡‹öehV!j_ Ture/fTicks^ÓN!j_ :N‚‚¦~5uDn؞¤‹¡‹öehV!j_

extern bool glo5Digitsture=false;//îO9e”NMO\pe¹pöe EAꁨRbkÈvbk_cÂSpe_sQ ÷‹9e:NtrueTîO9eNb—„vÂSpe ÝOX[sSïS ===

extern int glo5TP=500;//”NMO\pe¹pöebkÈv¹ppe 1uŽN0R¾ûy¨Rbk_cMOöeEA1\_ËYꁨRRybs^ÓN„vŸSàV

extern int glo5SL=320;//”NMO\pe¹pöebk_c¹ppe ÷‹nxÝObkÈvÏQûy¨Rbk_cTd–åN4—_0R„v/ftepe

extern int glo5moveSL=340;//”NMO\pe¹pöeûy¨Rbk_c¹ppe EA؞¤‹/fR”N!kRybs^ÓN

extern bool glo3Digitsture=false;//îO9e	NMO\pe¹pöe EAꁨRbkÈvbk_cÂSpe_sQ ÷‹9e:NtrueTîO9eNb—„vÂSpe ÝOX[sSïS ===

extern int glo3TP=620;//	NMO\pe¹pöebkÈv¹ppe ‚Yœg/fĞёøvsQ„v'^ù[ bkÈvbk_c>e'Y10
P

extern int glo3SL=520;//	NMO\pe¹pöebk_c¹ppe

extern int glo3moveSL=400;//	NMO\pe¹pöeûy¨Rbk_c¹ppe

extern bool glo2Digitsture=false;//îO9e$NMO\pe¹pöe EAꁨRbkÈvbk_cÂSpe_sQ ÷‹9e:NtrueTîO9eNb—„vÂSpe ÝOX[sSïS ===

extern int glo2TP=620;//$NMO\pe¹pöebkÈv¹ppe

extern int glo2SL=520;//$NMO\pe¹pöebk_c¹ppe

extern int glo2moveSL=400;//$NMO\pe¹pöeûy¨Rbk_c¹ppe

extern bool glojianjuture=false;//¾‹nhQ@\ô•ݍ_sQ §c6R@wEAhQ萄vbkÈvbk_cô•ݍ cUSô•ݍ                        ===

extern bool glojianju=false;///f&T/T(uhQ@\ô•ݍ /T(uTOåNNb—„vÂSpeîO9ete*NEA„vô•ݍ¾‹š[ ؞¤‹
N/T(u

extern int glojianjusl=3;//hQ@\bk_cô•ݍ

extern int glojianjutp=1;//hQ@\bkÈvô•ݍ

extern int glojianjuguadan=3;//hQ@\cUSô•ݍ

extern bool glomaxTotallotsture=false;//¾‹nhQ@\USTg'YNUS;`Kbpe_sQ ÷‹9e:NtrueTîO9eNb—„vÂSpe ÝOX[sSïS

extern double glomaxTotallots=5;//hQ@\USTg'YNUS;`Kbpe ؞¤‹/T¨R

extern bool glotickclosenumtrue=false;//¾‹nTickØSSgRÈpöeꁨRs^ÓN„˜¾‹<P_sQ ÷‹9e:NtrueTîO9eNb—„vÂSpe ÝOX[sSïS

extern double glotickclosenum=40;//TickØSSgRÈpöeꁨRs^ÓN„˜¾‹<P B/S+Tab+9

extern bool gloxianshijunjiantrue=false;//þVhˆ¢‹USáOo`/f&T>f:yGW÷N ÷‹9e:NtrueTîO9eNb—„vÂSpe ÝOX[sSïS

extern bool gloxianshijunjian=false;//þVhˆ¢‹USáOo`/f&T>f:yGW÷N ؞¤‹
N>f:y

string TPObjName,SLObjName;   //W[&{2Npenc/f(uegX[¨P‡e,g2N ~b0R„v£$Nag¿~„v
TW[

int    OrdersID[],OrdersCount,OpType;

double   ú^ÓN÷N,ûy¨Rbk_c=0;

/*

N0Ǒ(u‹¿R¿~¡‹—{·ƒ)Rbk_c÷N—‰èlaàQ¹pÿ



 1.þV
N	gYag‹¿R¿~„vÅ`µQÿåN¡{tYUS:N‹OÿÖSݍ»yS_MR÷N
N¹egя„vN9h‹¿R¿~\O:Nbkb‹¿R¿~ÿbk_c¿~:NN¹egя„vN9h0

 2.ЏLˆ-Nÿ(u7bïSåN–a9eØS‹¿R¿~„vMOnÿz^OꁨRý*Ž0

 3.R/T¨Röeÿz^ꁨRd"}0Rbkbbk_c‹¿R¿~Tÿ
NOQ9eØSÿsSO(u7bŠb	-N„v¿~Öb0R+R„v¿~KNY0

 4.ôfbcS_MRþV„vöeô•hTgO͑°e/T¨Rz^ÿQ!kd"}bkbbk_c¿~0

 5.‚Yœg(u7b Rd–ŸSHQ	-N„v‹¿R¿~ÿz^OꁨR͑°ed"}0

 6.‚YœgO(uI{ݍ»yS¿~ÿRYUSꁨR(u
Nb—N9h\O:NbkbÿNb—„v\O:Nbk_cÿzzUSøvÍS0

 7.
Nú^®‹O(u҉¦^¿~ÿàV:N҉¦^¿~ù[ŽNk¿~þV
N/fúVš[„vÿPWhtØSSOq_ÍT¿~
N÷N<h„v<P0



ŒN0ú^®‹Íd\O¹eÕlÿ



 1._ÓN

 2.(WþV-N>en}Ys^ÓN„vbkbbk_cchb‹¿R¿~

 3.ŠbOrdersGuardianÖbeQþV-Nÿ¾‹n}Yøv”^„vÂSpeÿú^®‹Šb/f&T>f:y:y‹O¿~¾‹:Ntrue0(W	y˜¾‹n„vcommonu˜Allow live tradingHQ
N‰SbþRÿS_MRþV„vóS
N҉”^å‹úQ°sN*NÉS0

 4.	cNå]wQh„vExpert Advisors	c®”ÿóS
N҉„vÉSOØSbN*NíT8ÿdköeEA(Wå]\OÿFO
NOs^ÓNÍd\O0

 5.‚YœgþV-N>f:y„vbkbbk_c¿~ŒT„˜gNôÿR	cë_wc.•F7ÿ	-NAllow live tradingÿ‚YœgóS
N҉þVhØSbN*N{8ÿEA1\_ËYck8^å]\OÑvƉcÓNUS†N0

*/



/*

extern string reminder04="=== ybϑcUSÂSpe¾‹n 4NöeŸ^_ ===";//؞¤‹åNg\„v\pe¹p:NúWÆQ

extern int guadanjuxianjia=50;//nc°s÷NY\cUS

extern double guadanlots=0.2;//cUSKbpe

extern int guadangeshu=5;//cUS*Npe

extern int guadanjianju=4;//cUSô•ݍ

extern int guadanSL=0;//cUSbk_cÿ0sS:N
N¾‹n

extern int guadanTP=0;//cUSbkÈvÿ0sS:N
N¾‹n

extern int guadanslippage=5;//cUSÑn¹ppe

*/

double buyline;

double sellline;

double slline;

double buylineOnTimer;

double selllineOnTimer;

double timebuyprice=0.0;

double timesellprice=10000.0;

double huaxianguadanlotsT=huaxianguadanlots;

int linebar01=linebar;

bool akey=false;

bool zkey=false;

bool ctrl=false;

bool ctrlR=false;

bool shift=false;

bool shiftR=false;

bool tab=false;

bool bkey=false;

bool skey=false;

bool pkey=false;

bool lkey=false;

bool tkey=false;

bool gkey=false;

bool okey=false;

bool kkey=false;

bool vkey=false;

bool fkey=false;

bool jkey=false;

bool dkey=false;

bool mkey=false;

bool nkey=false;

bool nakey=false;//;N.•ØvpeW[1 æ]¹„v	c.•

bool ikey=false;

bool fansuoYes=false;



bool huaxianSwitch=false;//R¿~s^ÓNb•ÓN

bool huaxianTimeSwitch=false;//R¿~s^ÓNb•ÓN

bool huaxiankaicang=false;

bool huaxianguadan=false;//R¿~cUS_sQ Tab+;N.•Øv1 ŒÕ‹6–µk

bool SL1mbuyLine=false;

bool SL1msellLine=false;

bool SL5mbuyLine=false;

bool SL5msellLine=false;

bool SL15mbuyLine=false;

bool SL15msellLine=false;

double SL1mbuyLineprice=Ask-1000*Point;

double SL1msellLineprice=Bid+1000*Point;

double SL5mbuyLineprice=Ask-1000*Point;

double SL5msellLineprice=Bid+1000*Point;

double SL15mbuyLineprice=Ask-1000*Point;

double SL15msellLineprice=Bid+1000*Point;

double SL1mbuyLineprice1;

double SL1msellLineprice1;

double SL5mbuyLineprice1;

double SL5msellLineprice1;

double SL15mbuyLineprice1;

double SL15msellLineprice1;

bool SLbuylinepingcang=false;

bool SLselllinepingcang=false;

bool SLbuylineQpingcang=false;//Q.• íw¿~æ‰ÊSs^ÓN š[öehV

bool SLselllineQpingcang=false;

bool SLbuylineQpingcangT=false;//Q.• íw¿~æ‰ÊSs^ÓN Tick

bool SLselllineQpingcangT=false;

double SLsellQpengcangline=Bid+1000*Point;

double SLbuyQpengcangline=Ask-1000*Point;



bool SLbuylinepingcang1=false;

bool SLselllinepingcang1=false;

bool SLbuylineQpingcang1=false;//Q.• íw¿~æ‰ÊSs^ÓN š[öehV

bool SLselllineQpingcang1=false;

bool SLbuylineQpingcangT1=false;//Q.• íw¿~æ‰ÊSs^ÓN Tick

bool SLselllineQpingcangT1=false;

double SLsellQpengcangline1=Bid+1000*Point;

double SLbuyQpengcangline1=Ask-1000*Point;



int SLlinepingcangjishu1=0;//

double SLQlotsT=SLQlots;



bool imbfxT=false;//

bool iBSTrend=false;//



datetime ctrltimeCurrent;

datetime ctrlRtimeCurrent;

datetime shifttimeCurrent;

datetime shiftRtimeCurrent;

datetime tabtimeCurrent;

datetime btimeCurrent;

datetime stimeCurrent;

datetime ptimeCurrent;

datetime ltimeCurrent;

datetime ttimeCurrent;

datetime shangtimeGMT=TimeGMT();//ß~¡‹ .•	cN„v!kpeöeO(u ¡‹öehV„vNÍy

datetime xiatimeGMT=TimeGMT();

datetime atimeCurrent;

datetime ztimeCurrent;

datetime gtimeCurrent;

datetime otimeCurrent;

datetime ktimeCurrent;

datetime vtimeCurrent;

datetime ftimeCurrent;

datetime dtimeCurrent;

datetime mtimeCurrent;

datetime ntimeCurrent;

datetime natimeCurrent;//~

datetime falsetimeCurrent;

datetime itimeCurrent;

datetime SL5QTPtimeCurrent;

bool SL5QTPtimeCurrenttrue=false;

bool timertrue=false;

bool onlybuy=true;

bool onlysell=true;

bool onlystp=false;

bool onlytpt=false;

bool onlyup=false;

bool onlydown=false;

bool onlybuy1=false;

bool onlysell1=false;

bool buymaxTotallots=false;//P–6RgYNUS;`Kbpe

bool sellmaxTotallots=false;//P–6RgYNUS;`Kbpe

bool notebook=false;//{°‹,g!j_

bool sellbaobenture=false;

bool buybaobenture=false;

bool tickclose=false;

bool huaxianShift=false;

bool huaxianCtrl=false;

bool tickShift=false;

bool linebuykaicang=false;

bool linekaicangshiftR=false;

int huaxiankaicanggeshuR1=huaxiankaicanggeshuR;//

int huaxiankaicanggeshu1=huaxiankaicanggeshu;//ö^ߏ

int huaxiankaicanggeshuT1=huaxiankaicanggeshuT;//ö^ߏ

int huaxianzidongjiacanggeshu1=huaxianzidongjiacanggeshu;

int huaxianzidongjiacanggeshutime1=huaxianzidongjiacanggeshutime;

bool linesellkaicang=false;

bool linebuyfansuo=false;

bool linesellfansuo=false;

bool linebuypingcang=false;

bool linebuypingcangR=false;

bool linebuypingcangC=false;

bool linebuypingcangctrlR=false;//æ‰ÊS*j¿~TݍS_MR÷NY\¾‹nbk_c

bool linesellpingcang=false;

bool linesellpingcangR=false;

bool linesellpingcangC=false;

bool linesellpingcangctrlR=false;//æ‰ÊS*j¿~TݍS_MR÷NY\¾‹nbk_c

bool linebuyzidongjiacang=false;

bool linesellzidongjiacang=false;

bool lineTime=false;

bool linefirsttime=true;

bool linekaicangT=false;//L+K _ÓNh°‹ Tab žX R_ÓN!kpeŒTô•”–öeô•_ÓN

bool dingshipingcang=false;//”NRŸ”6e¿~š[öes^ÓN

bool dingshipingcang15=false;//AS”NRŸ”6e¿~š[öes^ÓN



int linetime;

int xunhuanMagic=0;//9hncMagicª_¯ss^ÓN(u



bool linelock=false;

int shangpress=0;//ß~¡‹¹eT.•
N.•	cN„v!kpe

int xiapress=0;//ß~¡‹¹eT.•N.•	cN„v!kpe

int leftpress=0;//ß~¡‹¹eT.•
N.•	cN„v!kpe

int rightpress=0;//ß~¡‹¹eT.•N.•	cN„v!kpe

int tickjishu=4;

bool tickbuyclose=false;

int dingdanshu=100;//;N.•Øv0-9	cNpeW[ Ytgя„vàQUS

int dingdanshu1=100;//;N.•Øv0-9	cNpeW[ Ytgя„vàQUS N D  R\.•ØvpeW[O(u

int dingdanshu2=100;//;N.•Øv0-9	cNpeW[ Ytgя„vàQUS

int dingdanshu3=100;//;N.•Øv0-9	cNpeW[ Ytgя„vàQUS

int dingdanshu4=100;//;N.•Øv0-9	cNpeW[ Ytgя„vàQUS

int pingcangdingdanshu=1000;//;N.•Øv0-9	cNpeW[ Ytgя„vàQUS

int guadangeshu=huaxianguadangeshu;//\.•Øv1 2 3 cUS*Npe

double tick4,tick3,tick2,tick1,tick0;

int buydangeshu=0;

int selldangeshu=0;

int timesecondstrue;

int xiaoshudian=2;//Rybs^ÓN Ïk!kÓNMOÝOYu0RàQMO\pe¹p

double keylotshalfT;

double keylotshalf;



double timeseconds1=timeseconds1P;//

int holdingtime=holdingtimemin;

//bool juxianjiadingshi03=false;

datetime expiration=TimeCurrent()+expirationM*60;

datetime timeGMT1=D'1970.01.01 00:00:00';

datetime timeGMT2=D'1970.01.01 00:00:00';

datetime timeGMT3=D'1970.01.01 00:00:00';

datetime timeGMT4=D'1970.01.01 00:00:00';

datetime timeGMT5=D'1970.01.01 00:00:00';

datetime timeGMT6=D'1970.01.01 00:00:00';

double OriginalLot;

string reminder06="=== ybϑîO9ebkÈvbk_c¹ppebôv¥c“eQ÷NMO ===";//؞¤‹åN8^(u„v¹ppe:NúWÆQ  4Nöe_(u –Ï…ÂSpe

int StopLoss=0; // bk_c¹ppe¾‹n hQ:N0öeÖSˆmbkÈvbk_c

int TargetProfit=0; // bkÈv¹ppe¾‹n ¹ppeŒT÷NMOïSåN÷mTO(u

double FixedStopLoss=0.0; //bôv¥c“eQbk_c÷NMO ÷NMOOHQ N!k(uöe°‹—_nö–

double FixedTargetProfit=0.0; //bôv¥c“eQbkÈv÷NMO USìrO(uvQ-N„vNy˜
Nq_ÍTKNMR„v¾‹š[



double diancha;

double pianyilingGlo;

double stoplevel=MarketInfo(Symbol(),MODE_STOPLEVEL);//S_MR'^„v

double minlot=MarketInfo(Symbol(),MODE_MINLOT);//S_MR'^„vg\NUSϑ

string Exness="Exness Ltd.";

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int OnInit()

  {

   if(IsDemo())

     {

      SL5QTPpingcang=20;  //KmՋ(u

     }

   if(MarketInfo(Symbol(),MODE_LOTSTEP)==0.1)

     {

      xiaoshudian=1;

     }

   if(ObjectFind(0,"Buy Line")==0)

      ObjectDelete(0,"Buy Line");

   if(ObjectFind(0,"Sell Line")==0)

      ObjectDelete(0,"Sell Line");

   if(ObjectFind(0,"SL1mbuyLine")==0)

      ObjectDelete(0,"SL1mbuyLine");

   if(ObjectFind(0,"SL5mbuyLine")==0)

      ObjectDelete(0,"SL5mbuyLine");

   if(ObjectFind(0,"SL15mbuyLine")==0)

      ObjectDelete(0,"SL15mbuyLine");

   if(ObjectFind(0,"SL1msellLine")==0)

      ObjectDelete(0,"SL1msellLine");

   if(ObjectFind(0,"SL5msellLine")==0)

      ObjectDelete(0,"SL5msellLine");

   if(ObjectFind(0,"SL15msellLine")==0)

      ObjectDelete(0,"SL15msellLine");

   if(ObjectFind(0,"SLsellQpengcangline")==0)

      ObjectDelete(0,"SLsellQpengcangline");

   if(ObjectFind(0,"SLbuyQpengcangline")==0)

      ObjectDelete(0,"SLbuyQpengcangline");

   if(ObjectFind(0,"SLsellQpengcangline1")==0)

      ObjectDelete(0,"SLsellQpengcangline1");

   if(ObjectFind(0,"SLbuyQpengcangline1")==0)

      ObjectDelete(0,"SLbuyQpengcangline1");

   if(ObjectFind(0,"iBSTrend")==0)

      ObjectDelete(0,"iBSTrend");

   if(ObjectFind(0,"MBFX")==0)

      ObjectDelete(0,"MBFX");



   EventSetTimer(SetTimer);//š[öehV RËYS

   if(gloxianshijunjiantrue)//

     {

      if(gloxianshijunjian)

        {

         GlobalVariableSet("gloxianshijunjian",1);

         Print("þVhˆ¢‹USáOo`/f&T>f:yGW÷N >f:y ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("þVhˆ¢‹USáOo`/f&T>f:yGW÷N >f:y ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

      else

        {

         GlobalVariableSet("gloxianshijunjian",0);

         Print("þVhˆ¢‹USáOo`/f&T>f:yGW÷N 
N>f:y ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("þVhˆ¢‹USáOo`/f&T>f:yGW÷N 
N>f:y ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

     }

   else

     {

      if(GlobalVariableCheck("gloxianshijunjian"))

        {

         if(GlobalVariableGet("gloxianshijunjian")==0)

           {

            gloxianshijunjian=false;

           }

         else

           {

            gloxianshijunjian=true;

           }

        }

      else

        {

         GlobalVariableSet("gloxianshijunjian",0);

        }

     }

   if(glotickclosenumtrue)

     {

      string num="glotickclosenum"+Symbol();



      GlobalVariableSet(num,glotickclosenum);

      Print("TickØSSgRÈpöeꁨRs^ÓN„˜¾‹<Pò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

      Alert("TickØSSgRÈpöeꁨRs^ÓN„˜¾‹<Pò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

     }

   else

     {

      string num="glotickclosenum"+Symbol();

      if(GlobalVariableCheck(num))

        {

         glotickclosenum=GlobalVariableGet(num);

        }

      else

        {

         GlobalVariableSet(num,glotickclosenum);

        }

     }

   if(glomaxTotallotsture)

     {

      GlobalVariableSet("glomaxTotallots",glomaxTotallots);

      Print("hQ@\USTgYNUSKbpeP–6Rò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

      Alert("hQ@\USTgYNUS;`KbpeP–6Rò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

     }

   else

     {

      if(GlobalVariableCheck("glomaxTotallots"))

         Print("hQ@\USTgYNUS;`KbpeP–6R/T(u S_MRg'YïSN",GlobalVariableGet("glomaxTotallots"),"Kb");

      else

         GlobalVariableSet("glomaxTotallots",glomaxTotallots);

     }

   if(glojianjuture)//¾‹nô•ݍ„vhQ@\ýQpe

     {

      GlobalVariableSet("glojianjusl",glojianjusl);

      GlobalVariableSet("glojianjutp",glojianjutp);

      GlobalVariableSet("glojianjuguadan",glojianjuguadan);

      if(GlobalVariableCheck("glojianjusl"))

         Print("hQ@\„vô•ݍýQpe¾‹nbŸR");

      if(glojianju)

        {

         GlobalVariableSet("glojianju",1);

         Print("hQ@\ô•ݍò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("hQ@\ô•ݍò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

      else

        {

         GlobalVariableDel("glojianju");

         Print("hQ@\ô•ݍò]sQí• ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("hQ@\ô•ݍò]sQí• ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

     }

   if(GlobalVariableCheck("glojianju") && GlobalVariableCheck("glojianjusl"))//$R­ehQ@\ô•ݍ¾‹nv^gbLˆ

     {

      int sl=StrToInteger(DoubleToStr(GlobalVariableGet("glojianjusl"),0));

      int tp=StrToInteger(DoubleToStr(GlobalVariableGet("glojianjutp"),0));

      int gd=StrToInteger(DoubleToStr(GlobalVariableGet("glojianjuguadan"),0));

      jianju07=sl;

      jianju07tp=tp;

      jianju10=sl;

      jianju10tp=tp;

      piliangtpjianju=tp;

      piliangsljianju=sl;

      jianju03=sl;

      jianju04=tp;

      dingshijianju05=sl;

      dingshijianju06=tp;

      zhinengSLTPjianju=tp;

      jianju05=tp;

      Guadanjianju=gd;

      Guadanjianju1=gd;

      zhinengguadanjianju=gd;

      fibGuadanjianju=gd;

      tenGuadanjianju=gd;

      tensltpjianju=tp;

      huaxianguadanjianju=gd;

      Print("hQ@\ô•ݍò]/T(u ò]îO9eô•ݍ:N¨`„v¾‹š[<P hQ@\bk_cô•ݍ ",sl," hQ@\bkÈvô•ݍ ",tp," hQ@\cUSô•ݍ ",gd," ‚YÂSpe
Nù[ ÷‹Í‘°eôf°ehQ@\ô•ݍT R}");

     }

   if(globalVariablesDeleteAll)//RËYS¢[7bïzhQ@\ýQpe¾‹n

     {

      int Num=GlobalVariablesDeleteAll(NULL,0);

      if(Num>0)

        {

         Alert(" Rd–hQ萄v¢[7bïzhQ@\ýQpebŸR ÷‹Í‘°e R}EA");

         Print(" Rd–hQ萄v¢[7bïzhQ@\ýQpebŸR ÷‹Í‘°e R}EA");

        }

     }

   if(gloGraduallytrue)

     {

      if(Gradually)

        {

         GlobalVariableDel("gloGraduallyfalse");

         Print("Reks^ÓN!j_ò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("Reks^ÓN!j_ò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

      else

        {

         GlobalVariableSet("gloGraduallyfalse",1);

         Print("Reks^ÓN!j_ò]sQí• ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("Reks^ÓN!j_ò]sQí• ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

     }

   if(GlobalVariableCheck("gloGraduallyfalse"))

     {

      Gradually=false;

      Print("Reks^ÓN!j_ò]sQí•");

     }

   else

     {

      Gradually=true;

     }



   if(gloTickmodetrue)

     {

      if(Tickmode)

        {

         GlobalVariableSet("gloTickmodetrue",1);

         Print("TickReks^ÓN!j_ò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("TickReks^ÓN!j_ò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

      else

        {

         GlobalVariableDel("gloTickmodetrue");

         Print("¡‹öehVReks^ÓN!j_ò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

         Alert("¡‹öehVReks^ÓN!j_ò]/T(u ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

        }

     }

   if(glo5Digitsture)

     {

      GlobalVariableSet("glo5tp",glo5TP);

      GlobalVariableSet("glo5sl",glo5SL);

      GlobalVariableSet("glo5movesl",glo5moveSL);

      Alert("”NMO\pe¹pöeꁨRbkÈvbk_cÂSpeò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

      Print("”NMO\pe¹pöeꁨRbkÈvbk_cÂSpeò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

     }

   else

     {

      if(!GlobalVariableCheck("glo5tp"))

        {

         GlobalVariableSet("glo5tp",glo5TP);

         GlobalVariableSet("glo5sl",glo5SL);

         GlobalVariableSet("glo5movesl",glo5moveSL);

         Print("”NMO\pe¹pöeEAbkÈvbk_cRËYSŒ[b");

        }

     }

   if(glo3Digitsture)

     {

      GlobalVariableSet("glo3tp",glo3TP);

      GlobalVariableSet("glo3sl",glo3SL);

      GlobalVariableSet("glo3movesl",glo3moveSL);

      Alert("	NMO\pe¹pöeꁨRbkÈvbk_cÂSpeò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

      Print("	NMO\pe¹pöeꁨRbkÈvbk_cÂSpeò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

     }

   else

     {

      if(!GlobalVariableCheck("glo3tp"))

        {

         GlobalVariableSet("glo3tp",glo3TP);

         GlobalVariableSet("glo3sl",glo3SL);

         GlobalVariableSet("glo3movesl",glo3moveSL);

         Print("	NMO\pe¹pöeEAbkÈvbk_cRËYSŒ[b");

        }

     }

   if(glo2Digitsture)

     {

      GlobalVariableSet("glo2tp",glo2TP);

      GlobalVariableSet("glo2sl",glo2SL);

      GlobalVariableSet("glo2movesl",glo2moveSL);

      Alert("$NMO\pe¹pöeꁨRbkÈvbk_cÂSpeò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

      Print("$NMO\pe¹pöeꁨRbkÈvbk_cÂSpeò]ôf°e ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

     }

   else

     {

      if(!GlobalVariableCheck("glo2tp"))

        {

         GlobalVariableSet("glo2tp",glo2TP);

         GlobalVariableSet("glo2sl",glo2SL);

         GlobalVariableSet("glo2movesl",glo2moveSL);

         Print("$NMO\pe¹pöeEAbkÈvbk_cRËYSŒ[b");

        }

     }

   if(Digits==5 && GlobalVariableCheck("glo5tp"))

     {

      stoploss=GlobalVariableGet("glo5sl");

      takeprofit=GlobalVariableGet("glo5tp");

      TrailingStop=GlobalVariableGet("glo5movesl");

     }

   if(Digits==3 && GlobalVariableCheck("glo3tp"))

     {

      if(Bid<800)

        {

         stoploss=GlobalVariableGet("glo3sl");

         takeprofit=GlobalVariableGet("glo3tp");

         TrailingStop=GlobalVariableGet("glo3movesl");//
N/fĞёøvsQ„v'^ù[

        }

      else

        {

         stoploss=GlobalVariableGet("glo3sl")*10;

         takeprofit=GlobalVariableGet("glo3tp")*10;

         TrailingStop=GlobalVariableGet("glo3movesl")*10;///fĞёøvsQ„v'^ù[bkÈvbk_c>e'Y10
P

         linepianyi=linepianyi*10;//*j¿~OPûy>e'Y10
P

         Print("3MO\pe¹p /fĞёøvsQ„v'^ù[bkÈvbk_c>e'Y10
P");

        }

     }

   if(Digits==2 && GlobalVariableCheck("glo2tp"))

     {

      stoploss=GlobalVariableGet("glo2sl");

      takeprofit=GlobalVariableGet("glo2tp");

      TrailingStop=GlobalVariableGet("glo2movesl");

     }

   if(GlobalVariableCheck("gloTickmodetrue"))

     {

      if(Gradually)

        {

         Tickmode=true;

         Print("TickReks^ÓN!j_/T(u");

        }

      else

        {

         Print("TickReks^ÓN!j_sQí•");

        }

     }

   else

     {

      if(Gradually)

        {

         Tickmode=false;

         Print("¡‹öehVReks^ÓN!j_/T(u ","Ïk!ks^ÓN„vÓNMOÝOYu0R ",xiaoshudian," MO\pe¹p");

        }

      else

        {

         Print("¡‹öehVReks^ÓN!j_ sQí•");

        }

     }

   if(glolotsture)

     {

      GlobalVariableSet("glodefaultlots",defaultlots);

      Print("؞¤‹NUSKbpeôf°ebŸR");

      Alert("؞¤‹NUSKbpeôf°ebŸR S_MR:N",GlobalVariableGet("glodefaultlots"),"Kb ÷‹Í‘°e R}EAbŠbù[”^„v_sQ9e:Nfalse");

      if(ObjectFind("firstPS")!=-1)

         ObjectDelete("firstPS");

     }

   if(MarketInfo(Symbol(),MODE_TRADEALLOWED)==0)

      Print(Symbol()," S_MRÁTÍy
NAQ¸‹¤Nf");

   Print("EA؞¤‹ïSåNôv¥c&^bk_cNUSÿ‚YœgàeÕlNUS÷‹(W hQ@\¾‹n ̑îO9e");

   /* //FXTM°s(Wò]Ï~/ec&^bk_cNUS†N

     string ForexTime="ForexTime";

     if(ForexTime==StringSubstr(AccountServer(),0,9))

       {

        if(!GlobalVariableCheck("ForexTime"))

          {

           GlobalVariableSet(StringSubstr(AccountServer(),0,9),1);

           testtradeSLSP=false;

           Print("9hncYGl
g¡RhV{|‹W EAò]îO9e:N
Ný€ôv¥c&^bk_cNUS");

          }

        else

          {

           testtradeSLSP=false;

           Print("9hncYGl
g¡RhV{|‹W EAò]îO9e:N
Ný€ôv¥c&^bk_cNUS");

          }

       }

       */

   if(defaultlotstrue)

     {

      if(GlobalVariableCheck("glodefaultlots"))

        {

         defaultlots=GlobalVariableGet("glodefaultlots");

        }

      else

        {

         Alert("-Nôf°eT¨`„vúW,gNUSKbpe ؞¤‹0.1Kb dkˆmo`êSÐc:yN!k");

         Alert("ÀhKm0R¨`/f,{N!k R}MT4cÓN©RKb ÷‹(W ¢[7bïzhQ@\ýQpe¾‹n");

         Print("ÀhKm0R¨`/f,{N!k R}MT4cÓN©RKb ÷‹(W ¢[7bïzhQ@\ýQpe¾‹n -Nôf°eT¨`„vúW,gNUSKbpe ؞¤‹0.1Kb dkˆmo`êSÐc:yN!k");

         if(ObjectFind("firstPS")!=-1)

            ObjectDelete("firstPS");

           {

            ObjectCreate(0,"firstPS",OBJ_LABEL,0,0,0);

            ObjectSetInteger(0,"firstPS",OBJPROP_CORNER,CORNER_LEFT_UPPER);

            ObjectSetInteger(0,"firstPS",OBJPROP_XDISTANCE,dingdanxianshiX);

            ObjectSetInteger(0,"firstPS",OBJPROP_YDISTANCE,dingdanxianshiY+160);

            ObjectSetText("firstPS","÷‹	cF7 ¢[7bïzhQ@\ýQpe¾‹n -Nôf°eT¨`„vúW,gNUSKbpe؞¤‹0.1Kb ",18,"ўSO",dingdanxianshicolor);

           }

         GlobalVariableSet("glodefaultlots",0.1);

         defaultlots=GlobalVariableGet("glodefaultlots");

        }

      //Print("glodefaultlots ",GlobalVariableCheck("glodefaultlots"));

      keylots=defaultlots;

      Guadanlots=defaultlots;

      Guadanlots1=defaultlots;

      zhinengguadanlots=defaultlots;

      fibGuadanlots=defaultlots;

      tenGuadanlots=defaultlots;

      huaxianguadanlots=defaultlots;

      huaxiankaicanglotsT=defaultlots;

      //Print("keylots= ",keylots);

      Print("S_MREAÇ.•Øvë_wc.•NUS„vúW,gÓNMO/f ",defaultlots," Kb ÷‹ ¢[7bïzhQ@\ýQpe¾‹n -Nôf°e:NTêñ]„vÓNMONUS");

     }

   else

     {

      Print("S_MREAÇ.•Øvë_wc.•NUS„vúW,gÓNMO/f ",keylots," Kb ÷‹îO9e:NTêñ]„vÓNMONUS");

     }

   Print("S_MR'^ \Pbk4ls^MO: ",StrToInteger(DoubleToStr(stoplevel,0)),"ÿ&7b`gFgÔk‹O: ",AccountLeverage(),":1","ÿpNNKbÝOÁ‹Ñ‘ ",MarketInfo(Symbol(),MODE_MARGINREQUIRED),AccountCurrency(),", YUS”–Y)Ro`: ",MarketInfo(Symbol(),MODE_SWAPLONG),",zzUS”–Y)Ro`: ",MarketInfo(Symbol(),MODE_SWAPSHORT),swaptype());



   int level=AccountStopoutLevel();

   if(AccountStopoutMode()==0)

     {

      Print(":_Lˆs^ÓNbk_c4ls^= ",level,"% ,",Digits(),"MO\pe¹p"",NKbâl¨RN*NúW¹pÈvN ",DoubleToString(MarketInfo(Symbol(),MODE_TICKVALUE),2),AccountCurrency()," g\NUSKbpe",MarketInfo(Symbol(),MODE_MINLOT),"  EAswitch= ",EAswitch);

     }

   else

     {

      Print(":_Lˆs^ÓNbk_c4ls^= ",level," ",AccountCurrency());

     }

   keylotshalfT=MathFloor(keylots*0.5/MarketInfo(Symbol(),MODE_LOTSTEP))*MarketInfo(Symbol(),MODE_LOTSTEP);

   keylotshalf=keylots;

   if(Guadanprice<stoplevel)

      Guadanprice=StrToInteger(DoubleToStr(stoplevel,0))+2;

   if(Guadanjuxianjia<stoplevel)

      Guadanjuxianjia=StrToInteger(DoubleToStr(stoplevel,0))+2;

   if(Guadanjuxianjia1<stoplevel)

      Guadanjuxianjia1=StrToInteger(DoubleToStr(stoplevel,0))+2;

   if(zhinengSLTP1<stoplevel)

      zhinengSLTP1=stoplevel+2;

   if(minlot>defaultlots)

      Alert("EA؞¤‹NUSKbpe\ŽNS_MR'^g\NUSKbpe ïSý€àeÕlNUS ÷‹îO9e");

   if(EAswitch)

     {

      Print("S_MRþVhˆ",Digits,"MO\pe¹p"," EAꁨR¾‹nbkÈv",takeprofit,"¹p ","bk_c",stoploss,"¹p ","ûy¨Rbk_c",TrailingStop,"¹p");

      comment(StringFormat("%GMO\pe¹p bkÈv%G¹p bk_c%G¹p ûy¨Rbk_c%G¹p ؞¤‹NUSÓNMO%GKb",Digits,takeprofit,stoploss,TrailingStop,defaultlots));

      /*if(Digits==3 || Digits==2)

        {

         Gradually=false;

         Print("Reks^ÓN!j_ò]sQí•");

         comment1(StringFormat("%GMO\pe¹p Reks^ÓN¡lŒÕ‹}Y ‚föesQí•",Digits));

        }*/

     }

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

   ObjectsDeleteAll();

   if(ObjectFind(0,"buy")==0)

      ObjectDelete(0,"buy");

   if(ObjectFind(0,"sell")==0)

      ObjectDelete(0,"sell");

   if(ObjectFind(0,"buysell")==0)

      ObjectDelete(0,"buysell");

   if(ObjectFind(0,"AccountEquity")==0)

      ObjectDelete(0,"AccountEquity");

   if(ObjectFind(0,"AccountFreeMargin")==0)

      ObjectDelete(0,"AccountFreeMargin");

   if(ObjectFind(0,"zi")==0)

      ObjectDelete(0,"zi");

   if(ObjectFind(0,"zi1")==0)

      ObjectDelete(0,"zi1");

   if(ObjectFind(0,"botoupi")==0)

      ObjectDelete(0,"botoupi");

   if(ObjectFind(0,"firstPS")==0)

      ObjectDelete(0,"firstPS");

   if(ObjectFind(0,"Buy Line")==0)

      ObjectDelete(0,"Buy Line");

   if(ObjectFind(0,"Sell Line")==0)

      ObjectDelete(0,"Sell Line");

   if(ObjectFind(0,"SL Line")==0)

      ObjectDelete(0,"SL Line");

   if(ObjectFind(TPObjName)>=0)

      ObjectDelete(TPObjName);//ÍSRËYS0 Rd–¿~

   if(ObjectFind(SLObjName)>=0)

      ObjectDelete(SLObjName);

   if(ObjectFind(TP_PRICE_LINE)>=0)

      ObjectDelete(TP_PRICE_LINE);

   if(ObjectFind(SL_PRICE_LINE)>=0)

      ObjectDelete(SL_PRICE_LINE);

   if(ObjectFind(0,"SL1mbuyLine")==0)

      ObjectDelete(0,"SL1mbuyLine");

   if(ObjectFind(0,"SL5mbuyLine")==0)

      ObjectDelete(0,"SL5mbuyLine");

   if(ObjectFind(0,"SL15mbuyLine")==0)

      ObjectDelete(0,"SL15mbuyLine");

   if(ObjectFind(0,"SL1msellLine")==0)

      ObjectDelete(0,"SL1msellLine");

   if(ObjectFind(0,"SL5msellLine")==0)

      ObjectDelete(0,"SL5msellLine");

   if(ObjectFind(0,"SL15msellLine")==0)

      ObjectDelete(0,"SL15msellLine");

   if(ObjectFind(0,"SLsellQpengcangline")==0)

      ObjectDelete(0,"SLsellQpengcangline");

   if(ObjectFind(0,"SLbuyQpengcangline")==0)

      ObjectDelete(0,"SLbuyQpengcangline");

   if(ObjectFind(0,"SLsellQpengcangline1")==0)

      ObjectDelete(0,"SLsellQpengcangline1");

   if(ObjectFind(0,"SLbuyQpengcangline1")==0)

      ObjectDelete(0,"SLbuyQpengcangline1");

   if(ObjectFind(0,"iBSTrend")==0)

      ObjectDelete(0,"iBSTrend");

   if(ObjectFind(0,"MBFX")==0)

      ObjectDelete(0,"MBFX");

   Comment("");

   EventKillTimer();

  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnChartEvent(const int id,

                  const long &lparam,

                  const double &dparam,

                  const string &sparam)

  {

   if(id==CHARTEVENT_KEYDOWN && keycode)//ÀhKm.•Øv¨R\Oÿæ‰ÑScäN

     {

      if(StrToInteger(sparam)==29 || StrToInteger(sparam)==16413)

        {

         ctrl=true;

         ctrltimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==285|| StrToInteger(sparam)==16669)

        {

         ctrlR=true;

         ctrlRtimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==42 || StrToInteger(sparam)==16426)

        {

         shift=true;

         shifttimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==54 || StrToInteger(sparam)==16438)

        {

         shiftR=true;

         shiftRtimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==15 || StrToInteger(sparam)==16399)

        {

         tab=true;

         tabtimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==48 || StrToInteger(sparam)==16432)

        {

         bkey=true;

         btimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==31 || StrToInteger(sparam)==16415)

        {

         skey=true;

         stimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==25 || StrToInteger(sparam)==16409)

        {

         pkey=true;

         ptimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==38 || StrToInteger(sparam)==16422)

        {

         lkey=true;

         ltimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==20 || StrToInteger(sparam)==16404)

        {

         tkey=true;

         ttimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==30 || StrToInteger(sparam)==16414)

        {

         akey=true;

         atimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==44 || StrToInteger(sparam)==16428)

        {

         zkey=true;

         ztimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==34 || StrToInteger(sparam)==16418)

        {

         gkey=true;

         gtimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==24 || StrToInteger(sparam)==16408)

        {

         okey=true;

         otimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==37 || StrToInteger(sparam)==16421)

        {

         kkey=true;

         ktimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==47 || StrToInteger(sparam)==16431)

        {

         vkey=true;

         vtimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==33 || StrToInteger(sparam)==16417)

        {

         fkey=true;

         ftimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==32 || StrToInteger(sparam)==16416)

        {

         dkey=true;

         dtimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==50 || StrToInteger(sparam)==16434)

        {

         mkey=true;

         mtimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==49 || StrToInteger(sparam)==16433)

        {

         nkey=true;

         ntimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==23 || StrToInteger(sparam)==16407)

        {

         ikey=true;

         itimeCurrent=TimeCurrent();

        }

      if(StrToInteger(sparam)==41 || StrToInteger(sparam)==16425)//Test

        {

         // PiliangTP(true,NormalizeDouble(buyline+linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

         //PiliangTP(false,NormalizeDouble(buyline-linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

         Print("ꁨRRybs^ÓN= ",Gradually);

         Print("EA_sQ= ",EAswitch);

         Print("fansuoYes= ",fansuoYes);

         nakey=true;

         natimeCurrent=TimeCurrent();

         //Print("KmՋN(u");

         Print("MODE_SPREAD ",MarketInfo(Symbol(),MODE_SPREAD));

         Print("MODE_LOTSTEP ",MarketInfo(Symbol(),MODE_LOTSTEP));

         Print("MODE_MINLOT ",MarketInfo(Symbol(),MODE_MINLOT));

         Print("Ask ",MarketInfo(Symbol(),MODE_ASK));

         Print("Bid ",MarketInfo(Symbol(),MODE_BID));

         Print("GetLastError=",GetLastError());

         shifttimeCurrent=D'1970.01.01 00:00:00';//nd–Shift	c.•öeô•

         SL5QTPtimeCurrenttrue=false;//eR4Y®vš[öeYt¢‹USsQí•

         Print("eR4Y®vš[öeYt¢‹USsQí•");

         comment("eR4Y®vš[öeYt¢‹USsQí•");

         Print("YUSGW÷N= ",HoldingOrderbuyAvgPrice());

         Print("zzUSGW÷N= ",HoldingOrdersellAvgPrice());

         Print("linelock= ",linelock);

         //  Print("0.0=",MathRound(0.0));

         // double bid=StrToDouble(DoubleToString(1.2498,3));



         //double bid1=NormalizeDouble(bid,3);

         // Print("bid",bid," Digits",Digits);

         //Tenguadan(false,3,30);

         //Fibguadan(0,1.2400,1.2500);

         //Fibguadan(1,1.25000,1.26000);

        }

      if(StrToInteger(sparam)==70)

        {

         Print("s^gяN„vNUS Yt-N . . .");

         comment("s^gяN„vNUS Yt-N . . .");

         zuijinkeyclose();

        }

      if(Testsparam)

         Print(" sparam„v<P ",sparam," lparam„v<P ",lparam," dparam„v <P",dparam);//KmՋ.•Øv	c®”¶r`„vMO©cx„vW[&{2N<P,¹e¿Oꁚ[INë_wc.•ÿÄ~T.•Ctrl+Alt+W[ÍkbpeW[_N	gêñ]„vsparam„v<Pÿ@båN_NïSåNO(u0

      int Sparam=StrToInteger(sparam);

      switch(Sparam)

        {

         case 8219://_/T{°‹,gNUS	c.• Ctrl+Alt+ } _/T

           {

            if(notebook)

              {

               notebook=false;

               Print("{°‹,gNUS	c.•sQí•");

               comment("{°‹,gNUS	c.•sQí•");

              }

            else

              {

               notebook=true;

               Print("{°‹,gNUS	c.•_/Tbuybsell/fPbL.•óS¹,{ŒN*N.•");

               comment("{°‹,gNUS	c.•_/Tbuybsell/fPbL.•óS¹,{ŒN*N.•");

              }

           }

         break;

         case 27:

           {

            if(notebook)

              {

               Print("^÷NpNNUS Yt-N . . .");

               comment("^÷NpNNUS Yt-N . . .");

               int keybuy=OrderSend(Symbol(),OP_BUY,keylots,Ask,keyslippage,0,0,NULL,0,0);

               if(keybuy>0)

                  PlaySound("ok.wav");

               else

                 {

                  PlaySound("timeout.wav");

                  Print("Error=",GetLastError());

                 }

              }

            else

              {

               Print("{°‹,gNUS	c.•*g_/T Ctrl+Alt+ } _/T");

               comment("{°‹,gNUS	c.•*g_/T Ctrl+Alt+ } _/T");

              }

           }

         break;

         case 40:

           {

            if(notebook)

              {

               Print("^÷NVSNUS Yt-N . . .");

               comment("^÷NVSNUS Yt-N . . .");

               int keysell=OrderSend(Symbol(),OP_SELL,keylots,Bid,keyslippage,0,0,NULL,0,0);

               if(keysell>0)

                  PlaySound("ok.wav");

               else

                 {

                  PlaySound("timeout.wav");

                  Print("Error=",GetLastError());

                 }

              }

            else

              {

               Print("{°‹,gNUS	c.•*g_/T Ctrl+Alt+ } _/T");

               comment("{°‹,gNUS	c.•*g_/T Ctrl+Alt+ } _/T");

              }

           }

         break;

         case 328://¹eT.• 
N.•

           {

            if(shangtimeGMT+10>=TimeGMT())

              {

               shangpress++;

               Print("¹eT.• 
N.•	cN!kpe+1 S_MR¹eT.• 
N.•	cN!kpe",shangpress);

               comment(StringFormat("¹eT.•
N.• 	cN!kpe+1 S_MR	cN!kpe%G ",shangpress));

              }

            else

              {

               shangpress=1;

               Print("¡‹öehV10Òyò]Ǐ ¹eT.•
N.•¡‹pe͑n S_MR¹eT.• 
N.•	cN!kpe",shangpress);

               comment(StringFormat("¡‹öehV10Òyò]Ǐ ¹eT.•
N.•¡‹pe͑n S_MR	cN!kpe%G ",shangpress));

              }

            shangtimeGMT=TimeGMT();

           }

         break;

         case 336://¹eT.• N.•

           {

            if(xiatimeGMT+10>=TimeGMT())

              {

               xiapress++;

               Print("¹eT.• N.•	cN!kpe+1 S_MR¹eT.• N.•	cN!kpe",xiapress);

               comment(StringFormat("¹eT.•N.• 	cN!kpe+1 S_MR	cN!kpe%G ",xiapress));

              }

            else

              {

               xiapress=1;

               Print("¡‹öehV10Òyò]Ǐ ¹eT.•N.•¡‹pe͑n S_MR¹eT.• N.•	cN!kpe",xiapress);

               comment(StringFormat("¡‹öehV10Òyò]Ǐ ¹eT.•N.•¡‹pe͑n S_MR	cN!kpe%G ",xiapress));

              }

            xiatimeGMT=TimeGMT();

           }

         break;

         case 331://¹eT.• æ].•

           {

            if(shangtimeGMT+10>=TimeGMT())

              {

               leftpress++;

               Print("¹eT.• æ].•	cN!kpe+1 S_MR¹eT.• æ].•	cN!kpe",leftpress);

               comment(StringFormat("¹eT.•æ].•
0== 	cN!kpe+1 S_MR	cN!kpe%G ",leftpress));

              }

            else

              {

               leftpress=1;

               Print("¡‹öehV10Òyò]Ǐ ¹eT.•æ].•¡‹pe͑n S_MR¹eT.• æ].•	cN!kpe",leftpress);

               comment(StringFormat("¡‹öehV10Òyò]Ǐ ¹eT.•æ].•¡‹pe͑n S_MR	cN!kpe%G ",leftpress));

              }

            shangtimeGMT=TimeGMT();

           }

         break;

         case 333://¹eT.• óS.•

           {

            if(xiatimeGMT+10>=TimeGMT())

              {

               rightpress++;

               Print("¹eT.• óS.•	cN!kpe+1 S_MR¹eT.• óS.•	cN!kpe",rightpress);

               comment(StringFormat("¹eT.•óS.• ==0 	cN!kpe+1 S_MR	cN!kpe%G ",rightpress));

              }

            else

              {

               rightpress=1;

               Print("¡‹öehV10Òyò]Ǐ ¹eT.•óS.•¡‹pe͑n S_MR¹eT.• N.•	cN!kpe",rightpress);

               comment(StringFormat("¡‹öehV10Òyò]Ǐ ¹eT.•óS.•¡‹pe͑n S_MR	cN!kpe%G ",rightpress));

              }

            xiatimeGMT=TimeGMT();

           }

         break;

         case 2://;N.•Øv1 1111

           {

            if(itimeCurrent+1>=TimeCurrent())

              {

               if(imbfxT==false)

                 {

                  imbfxT=true;

                  Print("S_MRþVhˆÂS€MBFXch ꁨRs^ÓN _/T");

                  comment1("S_MRþVhˆÂS€MBFXch ꁨRs^ÓN _/T");

                  return;

                 }

               else

                 {

                  imbfxT=false;

                  Print("S_MRþVhˆÂS€MBFXch ꁨRs^ÓN sQí•");

                  comment1("S_MRþVhˆÂS€MBFXch ꁨRs^ÓN sQí•");

                  return;

                 }

              }

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(huaxianguadan)

                 {

                  huaxianguadan=false;

                  if(ObjectFind(TPObjName)>=0)

                     ObjectDelete(TPObjName);

                  if(ObjectFind(SLObjName)>=0)

                     ObjectDelete(SLObjName);

                  if(ObjectFind(TP_PRICE_LINE)>=0)

                     ObjectDelete(TP_PRICE_LINE);

                  if(ObjectFind(SL_PRICE_LINE)>=0)

                     ObjectDelete(SL_PRICE_LINE);

                  Print("R¿~cUS!j_sQí•");

                  comment1("R¿~cUS!j_sQí•");

                 }

               else

                 {

                  huaxianguadan=true;

                  huaxianSwitch=false;

                  huaxiankaicang=false;

                  Print("æ‰ÊSR¿~cUS!j__/T—‰ó\N*N¢‹USc_cUS¹eT");

                  comment1("æ‰ÊSR¿~cUS!j__/T—‰ó\N*N¢‹USc_cUS¹eT");

                 }

               tab=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(10*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(10*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(10*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(10*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=1;

            dingdanshu1=1;

            dingdanshu2=1;

            dingdanshu3=1;

            dingdanshu4=1;

            guadangeshu=1;

            comment(";N.•ØvpeW[.•1 êSYtgяN„vNUS ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 3://;N.•Øv2

           {

            if(itimeCurrent+1>=TimeCurrent())

              {

               if(iBSTrend==false)

                 {

                  iBSTrend=true;

                  Print("S_MRþVhˆÂS€BSTrendch ꁨRs^ÓN _/T");

                  comment1("S_MRþVhˆÂS€BSTrendch ꁨRs^ÓN _/T");

                  return;

                 }

               else

                 {

                  iBSTrend=false;

                  Print("S_MRþVhˆÂS€BSTrendch ꁨRs^ÓN sQí•");

                  comment1("S_MRþVhˆÂS€BSTrendch ꁨRs^ÓN sQí•");

                  return;

                 }

              }

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(huaxiankaicang)

                 {

                  huaxiankaicang=false;

                  if(ObjectFind(TPObjName)>=0)

                     ObjectDelete(TPObjName);

                  if(ObjectFind(SLObjName)>=0)

                     ObjectDelete(SLObjName);

                  if(ObjectFind(TP_PRICE_LINE)>=0)

                     ObjectDelete(TP_PRICE_LINE);

                  if(ObjectFind(SL_PRICE_LINE)>=0)

                     ObjectDelete(SL_PRICE_LINE);

                  Print("æ‰ÊSR¿~ôv¥c_ÓN!j_sQí•");

                  comment1("æ‰ÊSR¿~ôv¥c_ÓN!j_sQí•");

                 }

               else

                 {

                  huaxiankaicang=true;

                  huaxianSwitch=false;

                  huaxianguadan=false;

                  Print("æ‰ÊSR¿~ôv¥c_ÓN!j__/T —‰ó\N*N¢‹USc__ÓN¹eT");

                  comment1("æ‰ÊSR¿~ôv¥c_ÓN!j__/T —‰ó\N*N¢‹USc__ÓN¹eT");

                 }

               tab=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(20*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(20*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(20*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(20*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=2;

            dingdanshu1=2;

            dingdanshu2=2;

            dingdanshu3=2;

            dingdanshu4=2;

            guadangeshu=2;

            comment(";N.•ØvpeW[.• 2 êSYtgяN„v$NUS ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 4://;N.•Øv3

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(!timeGMTYesNo3)

                 {

                  if(tkey)

                    {

                     timeGMTYesNo3=true;

                     buytrue03=true;

                     Print("š[öehV3_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtbuyUS");

                     comment1("š[öehV3_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtbuyUS");

                     tkey=false;

                    }

                  else

                    {

                     if(fkey)

                       {

                        timeGMTYesNo3=true;

                        buytrue03=false;

                        Print("š[öehV3_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtsellUS");

                        comment1("š[öehV3_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtsellUS");

                        fkey=false;

                       }

                     else

                       {

                        Print("*gÀhKm0R	cNTbF.• š[öehV3—‰(W	cTab.•MRHQ	ébYt„v¢‹US{|‹W buyUS	cT sellUS	cF");

                        comment1("š[öehV3	cTab.•MRHQ	éb¢‹US{|‹WbuyUS	cT sellUS	cF");

                       }

                    }

                 }

               else

                 {

                  timeGMTYesNo3=false;

                  buytrue03=true;

                  timebuyprice=0.0;

                  timesellprice=10000.0;

                  Print("š[öehV3sQí•");

                  comment1("š[öehV3sQí•");

                 }

               tab=false;

               tkey=false;

               fkey=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(30*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(30*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(30*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(30*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=3;

            dingdanshu1=3;

            dingdanshu2=3;

            dingdanshu3=3;

            dingdanshu4=3;

            guadangeshu=3;

            comment(";N.•ØvpeW[.• 3 êSYtgяN„v	NUS ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 5://;N.•Øv4

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(!timeGMTYesNo4)

                 {

                  if(tkey)

                    {

                     timeGMTYesNo4=true;

                     buytrue04=true;

                     Print("š[öehV4_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtbuyUS");

                     comment1("š[öehV4_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtbuyUS");

                     tkey=false;

                    }

                  else

                    {

                     if(fkey)

                       {

                        timeGMTYesNo4=true;

                        buytrue04=false;

                        Print("š[öehV4_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtsellUS");

                        comment1("š[öehV4_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtsellUS");

                        fkey=false;

                       }

                     else

                       {

                        Print("*gÀhKm0R	cNTbF.• š[öehV6—‰(W	cTab.•MRHQ	ébYt„v¢‹US{|‹W buyUS	cT sellUS	cF");

                        comment1("š[öehV4	cTab.•MRHQ	éb¢‹US{|‹WbuyUS	cT sellUS	cF");

                       }

                    }

                 }

               else

                 {

                  timeGMTYesNo4=false;

                  buytrue04=true;

                  Print("š[öehV4sQí•");

                  comment1("š[öehV4sQí•");

                 }

               tab=false;

               tkey=false;

               fkey=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(40*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(40*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(40*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(40*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=4;

            dingdanshu1=4;

            dingdanshu2=4;

            dingdanshu3=4;

            dingdanshu4=4;

            guadangeshu=4;

            comment(";N.•ØvpeW[.• 4 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 6://;N.•Øv5

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(!timeGMTYesNo5)

                 {

                  if(tkey)

                    {

                     timeGMTYesNo5=true;

                     buytrue05=true;

                     Print("š[öehV5_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtbuyUS");

                     comment1("š[öehV5_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtbuyUS");

                     tkey=false;

                    }

                  else

                    {

                     if(fkey)

                       {

                        timeGMTYesNo5=true;

                        buytrue05=false;

                        Print("š[öehV5_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtsellUS");

                        comment1("š[öehV5_/T š[öeybϑzfý€ûy¨Rbk_cMO êSYtsellUS");

                        fkey=false;

                       }

                     else

                       {

                        Print("*gÀhKm0R	cNTbF.• š[öehV5—‰(W	cTab.•MRHQ	ébYt„v¢‹US{|‹W buyUS	cT sellUS	cF");

                        comment1("š[öehV5	cTab.•MRHQ	éb¢‹US{|‹WbuyUS	cT sellUS	cF");

                       }

                    }

                 }

               else

                 {

                  timeGMTYesNo5=false;

                  buytrue05=true;

                  Print("š[öehV5sQí•");

                  comment1("š[öehV5sQí•");

                 }

               tab=false;

               tkey=false;

               fkey=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(50*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(50*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(50*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(50*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=5;

            dingdanshu1=5;

            dingdanshu2=5;

            dingdanshu3=5;

            dingdanshu4=5;

            guadangeshu=5;

            comment(";N.•ØvpeW[.• 5 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 7://;N.•Øv6

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(!timeGMTYesNo6)

                 {

                  if(tkey)

                    {

                     timeGMTYesNo6=true;

                     buytrue06=true;

                     Print("š[öehV6_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtbuyUS");

                     comment1("š[öehV6_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtbuyUS");

                     tkey=false;

                    }

                  else

                    {

                     if(fkey)

                       {

                        timeGMTYesNo6=true;

                        buytrue06=false;

                        Print("š[öehV6_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtsellUS");

                        comment1("š[öehV6_/T š[öeybϑzfý€ûy¨RbkÈvMO êSYtsellUS");

                        fkey=false;

                       }

                     else

                       {

                        Print("*gÀhKm0R	cNTbF.• š[öehV6—‰(W	cTab.•MRHQ	ébYt„v¢‹US{|‹W buyUS	cT sellUS	cF");

                        comment1("š[öehV6	cTab.•MRHQ	éb¢‹US{|‹WbuyUS	cT sellUS	cF");

                       }

                    }

                 }

               else

                 {

                  timeGMTYesNo6=false;

                  buytrue06=true;

                  Print("š[öehV6sQí•");

                  comment1("š[öehV6sQí•");

                 }

               tab=false;

               tkey=false;

               fkey=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(60*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(60*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(60*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(60*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=6;

            dingdanshu1=6;

            dingdanshu2=6;

            dingdanshu3=6;

            dingdanshu4=6;

            guadangeshu=6;

            comment(";N.•ØvpeW[.• 6 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 8://;N.•Øv7

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(shiftR)

                 {

                  if(shift)

                    {

                     huaxianShift=true;

                     huaxianTimeSwitch=true;

                     huaxianguadan=false;

                     huaxiankaicang=false;

                     huaxianSwitch=false;

                     Print("R¿~ÍST•ÓNš[öehV!j__/T");

                     comment1("R¿~ÍST•ÓNš[öehV!j__/T");

                    }

                  else

                    {

                     if(ctrl)

                       {

                        huaxianCtrl=true;

                        huaxianTimeSwitch=true;

                        huaxianguadan=false;

                        huaxiankaicang=false;

                        huaxianSwitch=false;

                        Print("R¿~ÍSTI{ϑ_ÓNØSøv•ÓNš[öehV!j_ _/T");

                        comment1("R¿~ÍSTI{ϑ_ÓNØSøv•ÓNš[öehV!j_ _/T");

                       }

                     else

                       {

                        huaxianTimeSwitch=true;

                        huaxianguadan=false;

                        huaxiankaicang=false;

                        huaxianSwitch=false;

                        Print("R¿~s^ÓNš[öehV!j__/T");

                        comment1("R¿~s^ÓNš[öehV!j__/T");

                       }

                    }

                  shiftR=false;

                 }

               else

                 {

                  if(huaxianSwitch || huaxianTimeSwitch)

                    {

                     huaxianSwitch=false;

                     huaxianTimeSwitch=false;

                     huaxianShift=false;

                     huaxianCtrl=false;

                     if(ObjectFind(TPObjName)>=0)

                        ObjectDelete(TPObjName);

                     if(ObjectFind(SLObjName)>=0)

                        ObjectDelete(SLObjName);

                     if(ObjectFind(TP_PRICE_LINE)>=0)

                        ObjectDelete(TP_PRICE_LINE);

                     if(ObjectFind(SL_PRICE_LINE)>=0)

                        ObjectDelete(SL_PRICE_LINE);

                     Print("R¿~s^ÓNb•ÓN!j_sQí•");

                     comment1("R¿~s^ÓNb•ÓN!j_sQí•");

                    }

                  else

                    {

                     if(shift)

                       {

                        huaxianShift=true;

                        huaxianSwitch=true;

                        huaxianguadan=false;

                        huaxiankaicang=false;

                        Print("R¿~ÍST•ÓN!j__/T");

                        comment1("R¿~ÍST•ÓN!j__/T");

                       }

                     else

                       {

                        if(ctrl)

                          {

                           huaxianCtrl=true;

                           huaxianSwitch=true;

                           huaxianguadan=false;

                           huaxiankaicang=false;

                           Print("R¿~ÍSTI{ϑ_ÓNØSøv•ÓN!j_ _/T");

                           comment1("R¿~ÍSTI{ϑ_ÓNØSøv•ÓN!j_ _/T");

                          }

                        else

                          {

                           huaxianSwitch=true;

                           huaxianguadan=false;

                           huaxiankaicang=false;

                           Print("R¿~s^ÓN!j__/T");

                           comment1("R¿~s^ÓN!j__/T");

                          }

                       }



                    }

                  tab=false;

                  shift=false;

                  ctrl=false;

                 }

              }

            else

              {

               tab=false;

              }



            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(70*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(70*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(70*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(70*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=7;

            dingdanshu1=7;

            dingdanshu2=7;

            dingdanshu3=7;

            dingdanshu4=7;

            comment(";N.•ØvpeW[.• 7 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 9://;N.•Øv8

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(shiftRtimeCurrent+3>=TimeCurrent())

                 {

                  if(huaxianTimeSwitch)

                    {

                     huaxianTimeSwitch=false;

                     huaxianSwitch=false;

                     ·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN=2;

                     bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c=2;

                     if(ObjectFind(TPObjName)>=0)

                        ObjectDelete(TPObjName);

                     if(ObjectFind(SLObjName)>=0)

                        ObjectDelete(SLObjName);

                     if(ObjectFind(TP_PRICE_LINE)>=0)

                        ObjectDelete(TP_PRICE_LINE);

                     if(ObjectFind(SL_PRICE_LINE)>=0)

                        ObjectDelete(SL_PRICE_LINE);

                     Print("^—g&^s^ÓN š[öehV!j_ sQí•");

                     comment1("^—g&^s^ÓN š[öehV!j_ sQí•");

                    }

                  else

                    {

                     huaxianTimeSwitch=true;

                     huaxianSwitch=false;

                     huaxianguadan=false;

                     huaxiankaicang=false;

                     ·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN=1;

                     bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c=1;

                     Print("^—g&^s^ÓN š[öehV!j_ _/T ؞¤‹ÂSpe20");

                     comment1("^—g&^s^ÓN š[öehV!j_ _/T ؞¤‹ÂSpe20");

                    }

                  shiftR=false;

                 }

               else

                 {

                  if(huaxianSwitch || huaxianTimeSwitch)

                    {

                     huaxianSwitch=false;

                     huaxianTimeSwitch=false;

                     ·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN=2;

                     bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c=2;

                     if(ObjectFind(TPObjName)>=0)

                        ObjectDelete(TPObjName);

                     if(ObjectFind(SLObjName)>=0)

                        ObjectDelete(SLObjName);

                     if(ObjectFind(TP_PRICE_LINE)>=0)

                        ObjectDelete(TP_PRICE_LINE);

                     if(ObjectFind(SL_PRICE_LINE)>=0)

                        ObjectDelete(SL_PRICE_LINE);

                     Print("^—g&^s^ÓN!j_sQí•");

                     comment1("^—g&^s^ÓN!j_sQí•");

                    }

                  else

                    {

                     huaxianSwitch=true;

                     huaxianguadan=false;

                     huaxiankaicang=false;

                     ·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN=1;

                     bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c=1;

                     Print("^—g&^s^ÓN!j__/T ؞¤‹ÂSpe20");

                     comment1("^—g&^s^ÓN!j__/T ؞¤‹ÂSpe20");

                    }

                 }

               tab=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(80*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(80*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(80*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(80*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=8;

            dingdanshu1=8;

            dingdanshu2=8;

            dingdanshu3=8;

            dingdanshu4=8;

            comment(";N.•ØvpeW[.• 8 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 10://;N.•Øv9

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(tickclose)

                 {

                  tickclose=false;

                  tickShift=false;

                  Print("Tickpe<PØSSgRÈpöeꁨRs^ÓN sQí•");

                  comment1("Tickpe<PØSSgRÈpöeꁨRs^ÓN sQí•");

                 }

               else

                 {

                  if(bkey)

                    {

                     tickbuyclose=true;

                     if(shift)

                        tickShift=true;

                     tickclose=true;

                     Print("BuyUSTickpe<PØSSgRÈpöeꁨRs^ÓN _/T g'YØSS„˜¾‹<P",glotickclosenum," /T(uMR	cNNShiftۏeQŒÕ‹!j_","tickShift=",tickShift);

                     comment1("BuyUSTickpe<PØSSgRÈpöeꁨRs^ÓN _/T");

                     bkey=false;

                    }

                  if(skey)

                    {

                     if(shift)

                        tickShift=true;

                     tickclose=true;

                     Print("SellUSTickpe<PØSSgRÈpöeꁨRs^ÓN _/T g'YØSS„˜¾‹<P",glotickclosenum," /T(uMR	cNNShiftۏeQŒÕ‹!j_","tickShift=",tickShift);

                     comment1("SellUSTickpe<PØSSgRÈpöeꁨRs^ÓN _/T");

                     skey=false;

                    }

                 }

               tab=false;

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(90*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(90*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(90*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(90*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

            dingdanshu=9;

            dingdanshu1=9;

            dingdanshu2=9;

            dingdanshu3=9;

            dingdanshu4=9;

            comment(";N.•ØvpeW[.• 9 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 11://;N.•Øv0

           {

            if(tabtimeCurrent+2>=TimeCurrent() && tab==true)

              {

               if(EAswitch)

                 {

                  EAswitch=false;

                  Print("EAЏLˆ;`_sQ 4NöesQí• ‚Y—•öeô•sQí•÷‹	cF7îO9e");

                  comment1("EAЏLˆ;`_sQ 4NöesQí• ‚Y—•öeô•sQí•÷‹	cF7îO9e");

                 }

               else

                 {

                  if(Gradually)

                    {

                     Gradually=false;

                     EAswitch=true;

                     Print("EAЏLˆ;`_sQ_/T FOReks^ÓN!j_4NöesQí•");

                     comment1("EAЏLˆ;`_sQ_/T FOReks^ÓN!j_4NöesQí•");

                    }

                  else

                    {

                     EAswitch=true;

                     Gradually=true;

                     Print("EAЏLˆ;`_sQ _/T");

                     comment1("EAЏLˆ;`_sQ _/T");

                    }

                 }

               Print("Gradually=",Gradually);

               Print("EAswitch=",EAswitch);

              }

            else

              {

               tab=false;

              }

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey);

               piliangTPdianshu(0*piliangtpdianshu);

               pkey=false;

              }

            else

               pkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," l=",lkey);

               piliangSLdianshu(0*piliangsldianshu);

               lkey=false;

              }

            else

               lkey=false;

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSÖSˆmbkÈvbk_c Yt-N . . . ");

               comment("YUSÖSˆmbkÈvbk_c Yt-N . . . ");

               StopLoss=0;

               TargetProfit=0;

               FixedStopLoss=0.0;

               FixedTargetProfit=0.0;

               onlysell=false;

               piliangsltp();

               onlysell=true;

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSÖSˆmbkÈvbk_c Yt-N . . . ");

               comment("zzUSÖSˆmbkÈvbk_c Yt-N . . . ");

               StopLoss=0;

               TargetProfit=0;

               FixedStopLoss=0.0;

               FixedTargetProfit=0.0;

               onlybuy=false;

               piliangsltp();

               onlybuy=true;

               skey=false;

              }

            else

               skey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey);

               piliangTPnowdianshu(0*piliangtpdianshu);

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey);

               piliangSLnowdianshu(0*piliangtpdianshu);

               kkey=false;

              }

            else

               kkey=false;

            bkey=false;

            skey=false;

           }

         break;

         case 309://\.•Øv  "/".•

           {

            if(SLQlotsT==SLQlots)

              {

               SLQlotsT=SLQlots*2;

               Print("\.•Øv *.• ÌS
PKbpe_ÓN");

               comment("\.•Øv *.• ÌS
PKbpe_ÓN");

              }

            else

              {

               SLQlotsT=SLQlots;

               Print("\.•Øv *.• b`
Yck8^Kbpe_ÓN");

               comment("\.•Øv *.• b`
Yck8^Kbpe_ÓN");

              }

           }

         break;

         case 55://\.•Øv XN÷S.•

           {

            if(Tickmode)

              {

               if(SL15mbuyLine)

                 {

                  double buysl;

                  double buysl1=iLow(NULL,PERIOD_M1,iLowest(NULL,PERIOD_M1,MODE_LOW,SL1mQlinetimeframe,0))-SLQbuylinepianyi*Point;

                  double buysl2=Ask-50*Point;

                  Print("buysl1=",buysl1," buysl2=",buysl2);

                  if(buysl2>buysl1)

                    {

                     buysl=buysl1;

                    }

                  else

                    {

                     buysl=buysl2;

                    }

                  for(int i=SLQNum; i>0; i--)

                    {

                     int ticket=OrderSend(Symbol(),OP_BUY,SLQlotsT,Ask,6,buysl,Ask+SL5Qtp*Point,NULL,1688,0,CLR_NONE);

                     if(ticket>0)

                        PlaySound("ok.wav");

                     else

                        PlaySound("timeout.wav");

                     buysl=buysl-3*Point;

                    }

                  SL5QTPtimeCurrent=TimeCurrent();

                  SL5QTPtimeCurrenttrue=true;



                  SLbuylineQpingcang1=true;

                  SLbuylineQpingcangT1=true;

                  SetLevel("SLsellQpengcangline1",Bid+200*Point,DarkSlateGray);

                  SLsellQpengcangline1=Bid+200*Point;

                  Print("eR4Y®v BuyUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN  _/T");

                  comment("eR4Y®v BuyUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN _/T");

                 }

               else

                 {

                  double sellsl;

                  double sellsl1=iHigh(NULL,PERIOD_M1,iHighest(NULL,PERIOD_M1,MODE_HIGH,SL1mQlinetimeframe,0))+SLQselllinepianyi*Point;

                  double sellsl2=Bid+50*Point;

                  Print("sellsl1=",sellsl1," sellsl2=",sellsl2);

                  if(sellsl2<sellsl1)

                    {

                     sellsl=sellsl1;

                    }

                  else

                    {

                     sellsl=sellsl2;

                    }

                  for(int i=SLQNum; i>0; i--)

                    {

                     int ticket=OrderSend(Symbol(),OP_SELL,SLQlotsT,Bid,6,sellsl,Bid-SL5Qtp*Point,NULL,1688,0,CLR_NONE);

                     if(ticket>0)

                        PlaySound("ok.wav");

                     else

                        PlaySound("timeout.wav");

                     sellsl=sellsl+3*Point;

                    }

                  SL5QTPtimeCurrent=TimeCurrent();

                  SL5QTPtimeCurrenttrue=true;



                  SLselllineQpingcang1=true;

                  SLselllineQpingcangT1=true;

                  SetLevel("SLbuyQpengcangline1",Ask-200*Point,DarkSlateGray);

                  SLbuyQpengcangline1=Ask-200*Point;

                  Print("eR4Y®v SellUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN  _/T");

                  comment("eR4Y®v SellUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN _/T");

                 }

              }

           }

         break;

         case 82://\.•Øv0

           {

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuystopUS Yt-N . . .",Guadanprice));

               Guadanbuystop(huaxianguadanlotsT,Ask+Guadanprice*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

              }

            else

               pkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"ݍ°s÷N",Guadanprice,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuylimitUS Yt-N . . .",Guadanprice));

               Guadanbuylimit(huaxianguadanlotsT,Ask-Guadanprice*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

              }

            else

               okey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcsellstopUS Yt-N . . .",Guadanprice));

               Guadansellstop(huaxianguadanlotsT,Bid-Guadanprice*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

              }

            else

               lkey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"ݍ°s÷N",Guadanprice,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcselllimitUS Yt-N . . .",Guadanprice));

               Guadanselllimit(huaxianguadanlotsT,Bid+Guadanprice*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

              }

            else

               kkey=false;

           }

         break;

         case 79://\.•Øv1 j  1111

           {



            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 1 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 1 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,1,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 1 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 1 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,1,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbk_cS_MR÷NN¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangSL(true,Bid-zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbk_cS_MR÷N
N¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangSL(false,Ask+zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangSL(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)-zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangSL(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)+zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

              {

               Print("akey ",akey);

               akey=false;

              }



            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice1,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuystopUS Yt-N . . .",Guadanprice1));

               Guadanbuystop(huaxianguadanlotsT,Ask+Guadanprice1*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

              }

            else

               pkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"ݍ°s÷N",Guadanprice1,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuylimitUS Yt-N . . .",Guadanprice1));

               Guadanbuylimit(huaxianguadanlotsT,Ask-Guadanprice1*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

              }

            else

               okey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice1,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcsellstopUS Yt-N . . .",Guadanprice1));

               Guadansellstop(huaxianguadanlotsT,Bid-Guadanprice1*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

              }

            else

               lkey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"ݍ°s÷N",Guadanprice1,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcselllimitUS Yt-N . . .",Guadanprice1));

               Guadanselllimit(huaxianguadanlotsT,Bid+Guadanprice1*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

              }

            else

               kkey=false;

            guadangeshu=1;

            comment("\.•ØvpeW[.• 1 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 80://\.•Øv2 j

           {



            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 2 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 2 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,2,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 2 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 2 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,2,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbkÈvS_MR÷N
N¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbkÈvS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangTP(true,Bid+zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbkÈvS_MR÷NN¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbkÈvS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangTP(false,Ask-zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbkÈvGW÷N
N¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbkÈvGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangTP(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)+zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbkÈvGW÷NN¹e",zhinengSLTP1,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcÈvGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP1));

               PiliangTP(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)-zhinengSLTP1*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice2,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuystopUS Yt-N . . .",Guadanprice2));

               Guadanbuystop(huaxianguadanlotsT,Ask+Guadanprice2*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

              }

            else

               pkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"ݍ°s÷N",Guadanprice2,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuylimitUS Yt-N . . .",Guadanprice2));

               Guadanbuylimit(huaxianguadanlotsT,Ask-Guadanprice2*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

              }

            else

               okey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice2,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcsellstopUS Yt-N . . .",Guadanprice2));

               Guadansellstop(huaxianguadanlotsT,Bid-Guadanprice2*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

              }

            else

               lkey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"ݍ°s÷N",Guadanprice2,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcselllimitUS Yt-N . . .",Guadanprice2));

               Guadanselllimit(huaxianguadanlotsT,Bid+Guadanprice2*Point+press(),guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

              }

            else

               kkey=false;

            guadangeshu=2;

            comment("\.•ØvpeW[.• 2 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 81://\.•Øv3 j

           {



            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 3 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 3 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,3,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 3 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 3 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,3,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbk_cS_MR÷NN¹e",zhinengSLTP1*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP1*2));

               PiliangSL(true,Bid-zhinengSLTP1*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbk_cS_MR÷N
N¹e",zhinengSLTP1*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP1*2));

               PiliangSL(false,Ask+zhinengSLTP1*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP1*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP1*2));

               PiliangSL(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)-zhinengSLTP1*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP1*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP1*2));

               PiliangSL(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)+zhinengSLTP1*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

            if(ptimeCurrent+2>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice3,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuystopUS Yt-N . . .",Guadanprice3));

               Guadanbuystop(huaxianguadanlotsT,Ask+Guadanprice3*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

              }

            else

               pkey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"ݍ°s÷N",Guadanprice3,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcbuylimitUS Yt-N . . .",Guadanprice3));

               Guadanbuylimit(huaxianguadanlotsT,Ask-Guadanprice3*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

              }

            else

               okey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"ݍ°s÷N",Guadanprice3,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcsellstopUS Yt-N . . .",Guadanprice3));

               Guadansellstop(huaxianguadanlotsT,Bid-Guadanprice3*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

              }

            else

               lkey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"ݍ°s÷N",Guadanprice3,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("ݍ°s÷N%G¹pybϑcselllimitUS Yt-N . . .",Guadanprice3));

               Guadanselllimit(huaxianguadanlotsT,Bid+Guadanprice3*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

              }

            else

               kkey=false;

            guadangeshu=3;

            comment("\.•ØvpeW[.• 3 ,gÐc:yˆm1Y	c.•1YHe");

           }

         break;

         case 75://\.•Øv4

           {

            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 4 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 4 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,4,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 4 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 4 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,4,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+3>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbk_cS_MR÷NN¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangSL(true,Bid-zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+3>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbk_cS_MR÷N
N¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangSL(false,Ask+zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangSL(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)-zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangSL(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)+zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

            if(ptimeCurrent+3>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiHighest(0,Guadanprice4,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuystopUS Yt-N . . .",GetiHighest(0,Guadanprice4,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point));

               Guadanbuystop(Guadanlots,GetiHighest(0,Guadanprice4,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

               return;

              }

            else

               pkey=false;

            if(otimeCurrent+3>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"(W",GetiLowest(0,Guadanprice4,0)+Guadanbuylimitpianyiliang*Point,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuylimitUS Yt-N . . .",GetiLowest(0,Guadanprice4,0)+Guadanbuylimitpianyiliang*Point));

               Guadanbuylimit(Guadanlots,GetiLowest(0,Guadanprice4,0)+Guadanbuylimitpianyiliang*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

               return;

              }

            else

               okey=false;

            if(ltimeCurrent+3>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiLowest(0,Guadanprice4,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcsellstopUS Yt-N . . .",GetiLowest(0,Guadanprice4,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point));

               Guadansellstop(Guadanlots,GetiLowest(0,Guadanprice4,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

               return;

              }

            else

               lkey=false;

            if(ktimeCurrent+3>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"(W",GetiHighest(0,Guadanprice4,0)-Guadanselllimitpianyiliang*Point,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcselllimitUS Yt-N . . .",GetiHighest(0,Guadanprice4,0)-Guadanselllimitpianyiliang*Point));

               Guadanselllimit(Guadanlots,GetiHighest(0,Guadanprice4,0)-Guadanselllimitpianyiliang*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

               return;

              }

            else

               kkey=false;

           }

         break;

         case 76://\.•Øv5

           {

            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 5 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 5 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,5,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 5 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 5 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,5,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+3>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbkÈvS_MR÷N
N¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbkÈvS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangTP(true,Bid+zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+3>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbkÈvS_MR÷NN¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbkÈvS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangTP(false,Ask-zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbkÈvGW÷N
N¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbkÈvGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangTP(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)+zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbkÈvGW÷NN¹e",zhinengSLTP2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcÈvGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP2));

               PiliangTP(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)-zhinengSLTP2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

            if(ptimeCurrent+3>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiHighest(0,Guadanprice5,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuystopUS Yt-N . . .",GetiHighest(0,Guadanprice5,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press()));

               Guadanbuystop(Guadanlots,GetiHighest(0,Guadanprice5,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

               return;

              }

            else

               pkey=false;

            if(otimeCurrent+3>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"(W",GetiLowest(0,Guadanprice5,0)+Guadanbuylimitpianyiliang*Point,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuylimitUS Yt-N . . .",GetiLowest(0,Guadanprice5,0)+Guadanbuylimitpianyiliang*Point));

               Guadanbuylimit(Guadanlots,GetiLowest(0,Guadanprice5,0)+Guadanbuylimitpianyiliang*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

               return;

              }

            else

               okey=false;

            if(ltimeCurrent+3>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiLowest(0,Guadanprice5,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcsellstopUS Yt-N . . .",GetiLowest(0,Guadanprice5,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point));

               Guadansellstop(Guadanlots,GetiLowest(0,Guadanprice5,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

               return;

              }

            else

               lkey=false;

            if(ktimeCurrent+3>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"(W",GetiHighest(0,Guadanprice5,0)-Guadanselllimitpianyiliang*Point,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcselllimitUS Yt-N . . .",GetiHighest(0,Guadanprice5,0)-Guadanselllimitpianyiliang*Point+press()));

               Guadanselllimit(Guadanlots,GetiHighest(0,Guadanprice5,0)-Guadanselllimitpianyiliang*Point,Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

               return;

              }

            else

               kkey=false;

           }

         break;

         case 77://\.•Øv6

           {

            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 6 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 6 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,6,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 6 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 6 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,6,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+3>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbk_cS_MR÷NN¹e",zhinengSLTP2*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP2*2));

               PiliangSL(true,Bid-zhinengSLTP2*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+3>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbk_cS_MR÷N
N¹e",zhinengSLTP2*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP2*2));

               PiliangSL(false,Ask+zhinengSLTP2*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP2*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP2*2));

               PiliangSL(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)-zhinengSLTP2*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP2*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP2*2));

               PiliangSL(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)+zhinengSLTP2*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

           }

         break;

         case 71://\.•Øv7

           {

            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 7 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 7 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,7,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 7 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 7 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,7,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+3>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbk_cS_MR÷NN¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangSL(true,Bid-zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+3>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbk_cS_MR÷N
N¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangSL(false,Ask+zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangSL(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)-zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangSL(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)+zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

            if(ptimeCurrent+3>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiHighest(0,Guadanprice7,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuystopUS Yt-N . . .",GetiHighest(0,Guadanprice7,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press()));

               Guadanbuystop(Guadanlots,GetiHighest(0,Guadanprice7,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

               return;

              }

            else

               pkey=false;

            if(otimeCurrent+3>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"(W",GetiLowest(0,Guadanprice7,0)+Guadanbuylimitpianyiliang*Point,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuylimitUS Yt-N . . .",GetiLowest(0,Guadanprice7,0)+Guadanbuylimitpianyiliang*Point));

               Guadanbuylimit(Guadanlots,GetiLowest(0,Guadanprice7,0)+Guadanbuylimitpianyiliang*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

               return;

              }

            else

               okey=false;

            if(ltimeCurrent+3>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiLowest(0,Guadanprice7,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcsellstopUS Yt-N . . .",GetiLowest(0,Guadanprice7,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press()));

               Guadansellstop(Guadanlots,GetiLowest(0,Guadanprice7,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

               return;

              }

            else

               lkey=false;

            if(ktimeCurrent+3>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"(W",GetiHighest(0,Guadanprice7,0)-Guadanselllimitpianyiliang*Point,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcselllimitUS Yt-N . . .",GetiHighest(0,Guadanprice7,0)-Guadanselllimitpianyiliang*Point));

               Guadanselllimit(Guadanlots,GetiHighest(0,Guadanprice7,0)-Guadanselllimitpianyiliang*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

               return;

              }

            else

               kkey=false;

           }

         break;

         case 72://\.•Øv8 jian

           {

            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 8 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 8 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,8,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 8 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 8 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,8,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+3>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbkÈvS_MR÷N
N¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbkÈvS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangTP(true,Bid+zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+3>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbkÈvS_MR÷NN¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbkÈvS_MR÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangTP(false,Ask-zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbkÈvGW÷N
N¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbkÈvGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangTP(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)+zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbkÈvGW÷NN¹e",zhinengSLTP3,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcÈvGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP3));

               PiliangTP(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)-zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

            // if(ctrltimeCurrent+1>=TimeCurrent() && ctrl==true){Print("^÷N	N
PpNNUS Yt-N . . .");comment("^÷N	N
PpNNUS Yt-N . . .");int om=OrderSend(Symbol(),OP_BUY,keylots*3,Ask,keyslippage,0,0,NULL,0);if(om>0) PlaySound("ok.wav");else PlaySound("timeout.wav");ctrl=false;return;}

            //else ctrl=false;

            if(ptimeCurrent+3>=TimeCurrent() && pkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiHighest(0,Guadanprice8,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcbuystopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuystopUS Yt-N . . .",GetiHighest(0,Guadanprice8,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press()));

               Guadanbuystop(Guadanlots,GetiHighest(0,Guadanprice8,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               pkey=false;

               return;

              }

            else

               pkey=false;

            if(otimeCurrent+3>=TimeCurrent() && okey==true)

              {

               Print(" b=",bkey," s=",skey," o=",okey,"(W",GetiLowest(0,Guadanprice8,0)+Guadanbuylimitpianyiliang*Point,"¹pybϑcbuylimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcbuylimitUS Yt-N . . .",GetiLowest(0,Guadanprice8,0)+Guadanbuylimitpianyiliang*Point));

               Guadanbuylimit(Guadanlots,GetiLowest(0,Guadanprice8,0)+Guadanbuylimitpianyiliang*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               okey=false;

               return;

              }

            else

               okey=false;

            if(ltimeCurrent+3>=TimeCurrent() && lkey==true)

              {

               Print(" b=",bkey," s=",skey," p=",pkey,"(W",GetiLowest(0,Guadanprice8,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point,"¹pybϑcsellstopUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcsellstopUS Yt-N . . .",GetiLowest(0,Guadanprice8,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press()));

               Guadansellstop(Guadanlots,GetiLowest(0,Guadanprice8,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               lkey=false;

               return;

              }

            else

               lkey=false;

            if(ktimeCurrent+3>=TimeCurrent() && kkey==true)

              {

               Print(" b=",bkey," s=",skey," k=",kkey,"(W",GetiHighest(0,Guadanprice8,0)-Guadanselllimitpianyiliang*Point,"¹pybϑcselllimitUS Yt-N . . . ");

               comment(StringFormat("(W%G¹pybϑcselllimitUS Yt-N . . .",GetiHighest(0,Guadanprice8,0)-Guadanselllimitpianyiliang*Point));

               Guadanselllimit(Guadanlots,GetiHighest(0,Guadanprice8,0)-Guadanselllimitpianyiliang*Point+press(),Guadangeshu+rightpress,Guadanjianju+leftpress,Guadansl,Guadantp,Guadanjuxianjia);

               rightpress=0;

               leftpress=0;

               kkey=false;

               return;

              }

            else

               kkey=false;

           }

         break;

         case 73://\.•Øv9

           {

            if(ntimeCurrent+2>=TimeCurrent() && nkey==true)

              {

               Print("n=",nkey,"YUS¡‹—{gя 9 9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment("YUS¡‹—{gя 9 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(true,GetiLowest(timeframe10,9,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               nkey=false;

               return;

              }

            else

               nkey=false;

            if(dtimeCurrent+2>=TimeCurrent() && dkey==true)

              {

               Print("d=",dkey,"zzUS¡‹—{gя 9 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment("zzUS¡‹—{gя 9 9hK¿~ybϑzfý€bk_c Yt-N . . .");

               PiliangSL(false,GetiHighest(timeframe10,9,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10nom,juxianjia10,dingdanshu1);

               dkey=false;

               return;

              }

            else

               dkey=false;

            if(btimeCurrent+3>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUSybϑë_wcbk_cS_MR÷NN¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cS_MR÷NN¹e%G¹p Yt-N . . .",zhinengSLTP3*2));

               PiliangSL(true,Bid-zhinengSLTP3*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               bkey=false;

               return;

              }

            else

               bkey=false;

            if(stimeCurrent+3>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUSybϑë_wcbk_cS_MR÷N
N¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cS_MR÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3*2));

               PiliangSL(false,Ask+zhinengSLTP3*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               skey=false;

               return;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP3*2));

               PiliangSL(true,NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)-zhinengSLTP3*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3*2));

               PiliangSL(false,NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)+zhinengSLTP3*2*Point+press(),zhinengSLTPjianju,0,zhinengSLTPjuxianjia,dingdanshu2);

               akey=false;

               return;

              }

            else

               akey=false;

           }

         break;

         case 25://P jian

           {

            if(tabtimeCurrent+1>=TimeCurrent())

              {

               if(SLbuylineQpingcang==false && SLselllineQpingcang==false)

                 {

                  if(Tickmode)

                    {

                     if(SL15mbuyLine)

                       {

                        SLbuylineQpingcang=true;

                        SLbuylineQpingcangT=true;

                        timeseconds=1;

                        SetLevel("SLsellQpengcangline",Bid+200*Point,DarkSlateGray);

                        SLsellQpengcangline=Bid+200*Point;

                        Print("eR4Y®v BuyUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN  _/T");

                        comment("eR4Y®v BuyUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN _/T");

                       }

                     else

                       {

                        if(SL15msellLine)

                          {

                           SLselllineQpingcang=true;

                           SLselllineQpingcangT=true;

                           timeseconds=1;

                           SetLevel("SLbuyQpengcangline",Ask-200*Point,DarkSlateGray);

                           SLbuyQpengcangline=Ask-200*Point;

                           Print("eR4Y®v SellUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN  _/T");

                           comment("eR4Y®v SellUSíw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN _/T");

                          }

                       }

                    }

                 }

               else

                 {

                  SLbuylineQpingcang=false;

                  SLselllineQpingcang=false;

                  SLbuylineQpingcangT=false;

                  SLselllineQpingcangT=false;

                  timeseconds=2;

                  if(ObjectFind(0,"SLsellQpengcangline")==0)

                     ObjectDelete(0,"SLsellQpengcangline");

                  if(ObjectFind(0,"SLbuyQpengcangline")==0)

                     ObjectDelete(0,"SLbuyQpengcangline");

                  Print("eR4Y®v íw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN sQí• ");

                  comment("eR4Y®v íw¿~s^ÓN!j_ ÷N<hŠÇ*j¿~NUSNUSbkÈvs^ÓN sQí•");

                 }

              }

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               if(shiftR)

                 {

                  if(ObjectFind("Buy Line")==0 && linesellpingcangR==false)

                    {

                     linesellpingcangR=true;

                     linelock=true;

                     pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                     Print("sellUSŠÇ*j¿~NUSNUSs^ÓN _/T ÅNbkÈv(u buyUS(u sell Line sellUS(u buy Line");

                     comment("sellUS ŠÇ*j¿~NUSNUSs^ÓN _/T ÅNbkÈv(u ");

                    }

                 }

               else

                 {

                  if(tab)

                    {

                     if(ObjectFind("Buy Line")==0 && linebuypingcang==false && linebuypingcangR==false)

                       {

                        PiliangSL(true,buyline-(MarketInfo(Symbol(),MODE_SPREAD)+lineslpianyi)*Point,jianju07,0,1,10);

                        linebuypingcangC=true;

                        linelock=true;

                        pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                        Print("æ‰ÊS*j¿~hQs^ÓN š[öehV!j_ _/T");

                        comment("æ‰ÊS*j¿~hQs^ÓN š[öehV!j_ _/T");

                        tab=false;

                       }

                    }

                  else

                    {

                     if(ctrlRtimeCurrent+3>=TimeCurrent())

                       {

                        if(ObjectFind("Buy Line")==0 && linebuypingcang==false && linebuypingcangR==false && linebuypingcangC==false)

                          {

                           linebuypingcang=true;

                           linelock=true;

                           linebuypingcangctrlR=true;

                           pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                           Print("æ‰ÊS*j¿~TÍSTݍ*j¿~Y\¾‹nbk_cbkÈv _/T");

                           comment("æ‰ÊS*j¿~TÍSTݍ*j¿~Y\¾‹nbk_cbkÈv _/T");

                          }

                       }

                     else

                       {

                        if(ObjectFind("Buy Line")==0 && linebuypingcang==false && linebuypingcangR==false && linebuypingcangC==false)

                          {

                           linebuypingcang=true;

                           linelock=true;

                           pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                           Print("æ‰ÊS*j¿~hQs^ÓN _/T");

                           comment("æ‰ÊS*j¿~hQs^ÓN _/T");

                          }

                        else

                          {

                           if(linebuypingcang || linebuypingcangR || linebuypingcangC)

                             {

                              linebuypingcang=false;

                              linebuypingcangR=false;

                              linebuypingcangC=false;

                              linebuypingcangctrlR=false;

                              linelock=false;

                              Print("æ‰ÊS*j¿~s^ÓN sQí•");

                              comment("æ‰ÊS*j¿~s^ÓN sQí•");

                             }

                          }

                       }

                    }

                 }

               if(shiftR)

                 {

                  if(ObjectFind("Sell Line")==0 && linebuypingcangR==false)

                    {

                     linebuypingcangR=true;

                     linelock=true;

                     pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                     Print("buyUS ŠÇ*j¿~NUSNUSs^ÓN _/T ÅNbkÈv(u  buyUS(u sell Line sellUS(u buy Line");

                     comment("buyUS ŠÇ*j¿~NUSNUSs^ÓN _/T ÅNbkÈv(u");

                    }

                  shiftR=false;

                 }

               else

                 {

                  if(tab)

                    {

                     if(ObjectFind("Sell Line")==0 && linesellpingcang==false && linesellpingcangR==false)

                       {

                        PiliangSL(false,sellline+(MarketInfo(Symbol(),MODE_SPREAD)+lineslpianyi)*Point,jianju07,0,1,10);

                        linesellpingcangC=true;

                        linelock=true;

                        pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                        Print("æ‰ÊS*j¿~hQs^ÓN š[öehV!j_ _/T");

                        comment("æ‰ÊS*j¿~hQs^ÓN š[öehV!j_ _/T");

                        tab=false;

                       }

                    }

                  else

                    {

                     if(ctrlRtimeCurrent+3>=TimeCurrent())

                       {

                        if(ObjectFind("Sell Line")==0 && linesellpingcang==false && linesellpingcangR==false && linebuypingcangC==false)

                          {

                           linesellpingcang=true;

                           linesellpingcangctrlR=true;

                           linelock=true;

                           pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                           Print("æ‰ÊS*j¿~TÍSTݍ*j¿~Y\¾‹nbk_cbkÈv _/T");

                           comment("æ‰ÊS*j¿~TÍSTݍ*j¿~Y\¾‹nbk_cbkÈv _/T");

                          }

                       }

                     else

                       {

                        if(ObjectFind("Sell Line")==0 && linesellpingcang==false && linesellpingcangR==false && linebuypingcangC==false)

                          {

                           linesellpingcang=true;

                           linelock=true;

                           pingcangdingdanshu=dingdanshu;//êSYtgяN„vY\US ÐcMR;NpeW[.•

                           Print("æ‰ÊS*j¿~hQs^ÓN _/T");

                           comment("æ‰ÊS*j¿~hQs^ÓN _/T");

                          }

                        else

                          {

                           if(linesellpingcang || linesellpingcangR || linesellpingcangC)

                             {

                              linesellpingcang=false;

                              linesellpingcangR=false;

                              linesellpingcangC=false;

                              linesellpingcangctrlR=false;

                              linelock=false;

                              Print("æ‰ÊS*j¿~s^ÓN sQí•");

                              comment("æ‰ÊS*j¿~s^ÓN sQí•");

                             }

                          }

                       }

                    }

                 }

               lkey=false;

               pkey=false;

              }

            else

              {

               lkey=false;

              }

            if(gtimeCurrent+2>=TimeCurrent() && gkey==true)

              {

               Print("g=",gkey," zfý€buystopUS Yt-N. . .");

               comment(" zfý€buystopUS Yt-N. . .");

               zhinengguadanbuystop();

               gkey=false;

              }

            else

              {

               gkey=false;

              }

            if(mtimeCurrent+3>=TimeCurrent() && mkey==true)

              {

               if(shiftRtimeCurrent+3>=TimeCurrent())

                 {

                  if(dingshipingcang15)

                    {

                     dingshipingcang15=false;

                     Print("mkey=",mkey," S_MRAS”NRŸ”K¿~6e¿~öes^ÓN sQí•");

                     comment("S_MRAS”NRŸ”K¿~6e¿~öes^ÓN sQí•");

                     mkey=false;

                     pkey=false;

                    }

                  else

                    {

                     dingshipingcang15=true;

                     Print("mkey=",mkey," S_MRAS”NRŸ”K¿~6e¿~öes^ÓN  _/T");

                     comment("S_MRAS”NRŸ”K¿~6e¿~öes^ÓN _/T");

                     mkey=false;

                     pkey=false;

                    }

                 }

               else

                 {

                  if(dingshipingcang)

                    {

                     dingshipingcang=false;

                     Print("mkey=",mkey," S_MR”NRŸ”K¿~6e¿~öes^ÓN sQí•");

                     comment("S_MR”NRŸ”K¿~6e¿~öes^ÓN sQí•");

                     mkey=false;

                     pkey=false;

                    }

                  else

                    {

                     dingshipingcang=true;

                     Print("mkey=",mkey," S_MR”NRŸ”K¿~6e¿~öes^ÓN  _/T");

                     comment("S_MR”NRŸ”K¿~6e¿~öes^ÓN _/T");

                     mkey=false;

                     pkey=false;

                    }

                 }

              }

            else

              {

               mkey=false;

              }

           }

         break;

         case 38://L jian

           {

            if(ObjectFind("Buy Line")==0 || ObjectFind("SL Line")==0)

              {



              }

            else

              {

               if(gtimeCurrent+2>=TimeCurrent() && gkey==true)

                 {

                  Print("g=",gkey," zfý€sellstopUS Yt-N. . .");

                  comment(" zfý€sellstopUS Yt-N. . .");

                  zhinengguadansellstop();

                  gkey=false;

                  lkey=false;

                 }

               else

                  gkey=false;

              }

           }

         break;

         case 21://Y jian

           {

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey," YUSybϑ
NûyS_MRbkÈv",moveSTTP,"*N¹p");

               comment(StringFormat("YUSybϑ
NûyS_MRbkÈv%G¹p",moveSTTP));

               onlybuy1=true;

               onlytpt=true;

               movesttp();

               onlybuy1=false;

               onlytpt=false;

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey," zzUSybϑ
NûyS_MRbkÈv",moveSTTP,"*N¹p");

               comment(StringFormat("zzUSybϑ
NûyS_MRbkÈv%G*N¹p",moveSTTP));

               onlysell1=true;

               onlyup=true;

               movesttp();

               onlybuy1=false;

               onlyup=false;

               skey=false;

              }

            else

               skey=false;

           }

         break;

         case 34://G jian

           {

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               if(ObjectFind("Buy Line")==0)

                 {

                  if(shiftR)

                    {

                     if(ObjectFind("Buy Line")==0)

                       {

                        double sl=GetiLowest(0,7,0)-MarketInfo(Symbol(),MODE_SPREAD)*Point-50*Point;

                        Print("*j¿~YcBuylimitUS&^7Kzfý€bk_c Yt-N... ",sl);

                        comment("*j¿~YcBuylimitUS&^7Kzfý€bk_c Yt-N...");

                        Guadanbuylimit(huaxianguadanlotsT,NormalizeDouble(buyline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress,sl,huaxianguadantp,huaxianguadanjuxianjia);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        leftpress=0;

                        rightpress=0;

                       }

                     gkey=false;

                     lkey=false;

                     shiftR=false;

                    }

                  else

                    {

                     if(ctrlRtimeCurrent+3>=TimeCurrent())

                       {

                        Print("buyline=",NormalizeDouble(buyline,Digits));

                        Print("*j¿~YcsellstopUS Yt-N... ");

                        comment("*j¿~YcsellstopUS Yt-N...");

                        Guadansellstop(huaxianguadanlotsT,NormalizeDouble(buyline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress,hengxianguadansl,hengxianguadantp,huaxianguadanjuxianjia);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        leftpress=0;

                        rightpress=0;

                        ctrl=false;

                       }

                     else

                       {

                        if(ObjectFind("SL Line")==0)

                          {

                           Print("*j¿~Y&^bk_ccBuylimitUS(Wbk_c¿~bk_c  Yt-N... ",buyline);

                           comment("*j¿~Y&^bk_ccBuylimitUS(Wbk_c¿~bk_c Yt-N...");

                           Guadanbuylimit(huaxianguadanlotsT,NormalizeDouble(buyline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress,slline,huaxianguadantp,huaxianguadanjuxianjia);

                           if(ObjectFind(0,"Buy Line")==0)

                              ObjectDelete(0,"Buy Line");

                           if(ObjectFind(0,"Sell Line")==0)

                              ObjectDelete(0,"Sell Line");

                           if(ObjectFind(0,"SL Line")==0)

                              ObjectDelete(0,"SL Line");

                           leftpress=0;

                           rightpress=0;

                           gkey=false;

                           lkey=false;

                           return;

                          }

                        else

                          {

                           Print("*j¿~Y&^bk_ccBuylimitUS X.•ïSubbk_c¿~  Yt-N... ",buyline);

                           comment("*j¿~Y&^bk_ccBuylimitUS X.•ïSubbk_c¿~ Yt-N...");

                           Guadanbuylimit(huaxianguadanlotsT,NormalizeDouble(buyline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress-xiapress,hengxianguadansl,hengxianguadantp,huaxianguadanjuxianjia);

                           if(ObjectFind(0,"Buy Line")==0)

                              ObjectDelete(0,"Buy Line");

                           if(ObjectFind(0,"Sell Line")==0)

                              ObjectDelete(0,"Sell Line");

                           if(ObjectFind(0,"SL Line")==0)

                              ObjectDelete(0,"SL Line");

                           leftpress=0;

                           rightpress=0;

                           xiapress=0;

                           gkey=false;

                           lkey=false;

                           return;

                          }

                       }

                    }

                  return;

                 }

               if(ObjectFind("Sell Line")==0)

                 {

                  if(shiftR)

                    {

                     if(ObjectFind("Sell Line")==0)

                       {

                        double sl1=GetiHighest(0,7,0)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+50*Point;

                        Print("*j¿~YcSelllimitUS&^7Kzfý€bk_c Yt-N... ",sl1);

                        comment("*j¿~YcSelllimitUS&^7Kzfý€bk_c Yt-N...");

                        Guadanselllimit(huaxianguadanlotsT,NormalizeDouble(sellline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress,sl1,huaxianguadantp,huaxianguadanjuxianjia);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        leftpress=0;

                        rightpress=0;

                        gkey=false;

                        lkey=false;

                        shiftR=false;

                        return;

                       }

                    }

                  else

                    {

                     if(ctrlRtimeCurrent+3>=TimeCurrent())

                       {

                        Print("sellline=",NormalizeDouble(sellline,Digits));

                        Print("*j¿~YcbuystopUS Yt-N... ");

                        comment("*j¿~YcbuystopUS Yt-N...");

                        Guadanbuystop(huaxianguadanlotsT,NormalizeDouble(sellline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress,hengxianguadansl,hengxianguadantp,huaxianguadanjuxianjia);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        leftpress=0;

                        rightpress=0;

                        ctrl=false;

                        gkey=false;

                        lkey=false;

                        return;

                       }

                     else

                       {

                        if(ObjectFind("SL Line")==0)



                          {

                           Print("*j¿~YcSelllimitUS(Wbk_c¿~bk_c Yt-N... ",slline);

                           comment("*j¿~YcSelllimitUS(Wbk_c¿~bk_c Yt-N...");

                           Guadanselllimit(huaxianguadanlotsT,NormalizeDouble(sellline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress,slline,huaxianguadantp,huaxianguadanjuxianjia);

                           if(ObjectFind(0,"Buy Line")==0)

                              ObjectDelete(0,"Buy Line");

                           if(ObjectFind(0,"Sell Line")==0)

                              ObjectDelete(0,"Sell Line");

                           if(ObjectFind(0,"SL Line")==0)

                              ObjectDelete(0,"SL Line");

                           leftpress=0;

                           rightpress=0;

                           gkey=false;

                           lkey=false;

                           return;

                          }

                        else

                          {

                           Print("*j¿~YcSelllimitUS X.•ïSubbk_c¿~ Yt-N... ",sellline);

                           comment("*j¿~YcSelllimitUS X.•ïSubbk_c¿~ Yt-N...");

                           Guadanselllimit(huaxianguadanlotsT,NormalizeDouble(sellline,Digits),guadangeshu+rightpress,huaxianguadanjianju+leftpress-xiapress,hengxianguadansl,hengxianguadantp,huaxianguadanjuxianjia);

                           if(ObjectFind(0,"Buy Line")==0)

                              ObjectDelete(0,"Buy Line");

                           if(ObjectFind(0,"Sell Line")==0)

                              ObjectDelete(0,"Sell Line");

                           if(ObjectFind(0,"SL Line")==0)

                              ObjectDelete(0,"SL Line");

                           leftpress=0;

                           rightpress=0;

                           xiapress=0;

                           gkey=false;

                           lkey=false;

                           return;

                          }

                       }

                    }

                 }

               return;

              }

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey," YUSybϑNûyS_MRbkÈv",moveSTTP,"*N¹p");

               comment(StringFormat("YUSybϑNûyS_MRbkÈv%G*N¹p",moveSTTP));

               onlybuy1=true;

               onlydown=true;

               movesttp();

               onlybuy1=false;

               onlydown=false;

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey," zzUSybϑNûyS_MRbkÈv",moveSTTP,"*N¹p");

               comment(StringFormat("zzUSybϑNûyS_MRbkÈv%G*N¹p",moveSTTP));

               onlysell1=true;

               onlytpt=true;

               movesttp();

               onlybuy1=false;

               onlytpt=false;

               skey=false;

               gkey=false;

              }

            else

               skey=false;

           }

         break;

         case 20://T jian

           {

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               if(ObjectFind("Buy Line")==0)

                 {

                  Print("buyline=",NormalizeDouble(buyline,Digits));

                  if(shiftRtimeCurrent+3>=TimeCurrent())

                    {

                     if(buyline<Bid && GetHoldingsellOrdersCount()>0)

                       {

                        Print("SellUS¢~¿~Y¾‹nß~NbkÈv Yt-N... ");

                        comment("SellUS¢~¿~Y¾‹nß~NbkÈv Yt-N...");

                        PiliangTP(false,NormalizeDouble(buyline,Digits),0,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("¢~¿~Y(WS_MR÷N
N¹e SellUSàeÕl¾‹nbkÈv b¡l	gsellUS ");

                        comment("¢~¿~Y(WS_MR÷N
N¹e SellUSàeÕl¾‹nbkÈv b¡l	gsellUS");

                       }

                    }

                  else

                    {

                     if(buyline<Bid && GetHoldingsellOrdersCount()>0)

                       {

                        Print("SellUS¢~¿~Y¾‹nbkÈv Yt-N... ");

                        comment("SellUS¢~¿~Y¾‹nbkÈv Yt-N...");

                        PiliangTP(false,NormalizeDouble(buyline,Digits),jianju07tp,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("¢~¿~Y(WS_MR÷N
N¹e SellUSàeÕl¾‹nbkÈv b¡l	gsellUS ");

                        comment("¢~¿~Y(WS_MR÷N
N¹e SellUSàeÕl¾‹nbkÈv b¡l	gsellUS");

                       }

                    }

                 }

               if(ObjectFind("Sell Line")==0)

                 {

                  Print("sellline=",NormalizeDouble(sellline,Digits));

                  if(shiftRtimeCurrent+3>=TimeCurrent())

                    {

                     if(sellline>Ask && GetHoldingbuyOrdersCount()>0)

                       {

                        Print("BuyUSÿ~¿~Y¾‹nß~NbkÈv Yt-N... ");

                        comment("BuyUSÿ~¿~Y¾‹nß~NbkÈv Yt-N...");

                        PiliangTP(true,NormalizeDouble(sellline,Digits),0,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("ÿ~¿~Y(WS_MR÷NN¹e BuyUSàeÕl¾‹nbkÈv b¡l	gBuyUS ");

                        comment("ÿ~¿~Y(WS_MR÷NN¹e BuyUSàeÕl¾‹nbkÈv b¡l	gBuyUS");

                       }

                    }

                  else

                    {

                     if(sellline>Ask && GetHoldingbuyOrdersCount()>0)

                       {

                        Print("BuyUSÿ~¿~Y¾‹nbkÈv Yt-N... ");

                        comment("BuyUSÿ~¿~Y¾‹nbkÈv Yt-N...");

                        PiliangTP(true,NormalizeDouble(sellline,Digits),jianju07tp,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("ÿ~¿~Y(WS_MR÷NN¹e BuyUSàeÕl¾‹nbkÈv b¡l	gBuyUS ");

                        comment("ÿ~¿~Y(WS_MR÷NN¹e BuyUSàeÕl¾‹nbkÈv b¡l	gBuyUS");

                       }

                    }

                  if(ObjectFind(0,"Buy Line")==0)

                     ObjectDelete(0,"Buy Line");

                  if(ObjectFind(0,"Sell Line")==0)

                     ObjectDelete(0,"Sell Line");

                 }

               lkey=false;

               tkey=false;

              }

            else

              {

               lkey=false;

              }

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP3*2));

               Tensltp(true,false,tensltpweishu,tensltpmax);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3*2));

               Tensltp(false,false,tensltpweishu,tensltpmax);

               akey=false;

               return;

              }

            else

               akey=false;

            if(gtimeCurrent+2>=TimeCurrent() && gkey==true)

              {

               Print("g=",gkey," zfý€buylimitUS Yt-N. . .");

               comment(" zfý€buylimitUS Yt-N. . .");

               zhinengguadanbuylimit();

               gkey=false;

               return;

              }

            else

               gkey=false;

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey," YUSybϑ
NûyS_MRbk_c",moveSTTP,"*N¹p");

               comment(StringFormat("YUSybϑ
NûyS_MRbk_c%G*N¹p",moveSTTP));

               onlybuy1=true;

               onlyup=true;

               movesttp();

               onlybuy1=false;

               onlyup=false;

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey," zzUSybϑ
NûyS_MRbk_c",moveSTTP,"*N¹p");

               comment(StringFormat("zzUSybϑ
NûyS_MRbk_c%G*N¹p",moveSTTP));

               onlysell1=true;

               onlystp=true;

               movesttp();

               onlybuy1=false;

               onlystp=false;

               skey=false;

              }

            else

               skey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" o=",okey," tepeMOybϑcbuylimitUS“bÞV¤d Yt-N . . . ");

               comment("tepeMOybϑcbuylimitUS“bÞV¤d Yt-N . . . ");

               Tenguadan(true,tenweishu,tenmax);

               okey=false;

               return;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" k=",kkey," tepeMOybϑcselllimitUS“bÞV¤d Yt-N . . . ");

               comment("tepeMOybϑcselllimitUS“bÞV¤d Yt-N . . . ");

               Tenguadan(false,tenweishu,tenmax);

               kkey=false;

               return;

              }

            else

               kkey=false;

           }

         break;

         case 33://F jian

           {



            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey,"YUSybϑë_wcbk_cGW÷NN¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("YUSybϑë_wcbk_cGW÷NN¹e%G*N¹p Yt-N . . .",zhinengSLTP3*2));

               Tensltp(true,true,tensltpweishu,tensltpmax);

               vkey=false;

               return;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey,"zzUSybϑë_wcbk_cGW÷N
N¹e",zhinengSLTP3*2,"*N¹p Yt-N . . .");

               comment(StringFormat("zzUSybϑë_wcbk_cGW÷N
N¹e%G*N¹p Yt-N . . .",zhinengSLTP3*2));

               Tensltp(false,true,tensltpweishu,tensltpmax);

               akey=false;

               return;

              }

            else

               akey=false;

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey," YUSybϑNûyS_MRbk_c",moveSTTP,"*N¹p");

               comment(StringFormat("YUSybϑNûyS_MRbk_c%G*N¹p",moveSTTP));

               onlybuy1=true;

               onlystp=true;

               movesttp();

               onlybuy1=false;

               onlystp=false;

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey," zzUSybϑNûyS_MRbk_c",moveSTTP,"*N¹p");

               comment(StringFormat("zzUSybϑNûyS_MRbk_c%G*N¹p",moveSTTP));

               onlysell1=true;

               onlydown=true;

               movesttp();

               onlybuy1=false;

               onlydown=false;

               skey=false;

              }

            else

               skey=false;

            if(otimeCurrent+2>=TimeCurrent() && okey==true)

              {

               Print(" o=",okey," ¡‹—{gя„vgNOgؚ¹påNeâl£QY~vRÔkMOcbuylimitUS");

               comment("¡‹—{gя„vgNOgؚ¹påNeâl£QY~vRÔkMOcbuylimitUS Yt-N . . .");

               Print("¡‹—{„vgNO÷N",GetiLowest(timeframe08,bars08,beginbar08)," ¡‹—{„vgؚ÷N",GetiHighest(timeframe08,bars08,beginbar08)," OPûyϑ",fibbuypianyiliang);

               Fibguadan(0,GetiLowest(timeframe07,bars07,beginbar07),GetiHighest(timeframe08,bars08,beginbar08));

               okey=false;

              }

            else

               okey=false;

            if(ktimeCurrent+2>=TimeCurrent() && kkey==true)

              {

               Print(" k=",kkey," ¡‹—{gя„vgNOgؚ¹påNeâl£QY~vRÔkMOcselllimitUS");

               comment("¡‹—{gя„vgNOgؚ¹påNeâl£QY~vRÔkMOcselllimitUS Yt-N . . .");

               Print("¡‹—{„vgNO÷N",GetiLowest(timeframe08,bars08,beginbar08)," ¡‹—{„vgؚ÷N",GetiHighest(timeframe07,bars07,beginbar07)," OPûyϑ",fibsellpianyiliang);

               Fibguadan(1,GetiLowest(timeframe08,bars08,beginbar08),GetiHighest(timeframe07,bars07,beginbar07));

               kkey=false;

              }

            else

               kkey=false;

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {



               if(ObjectFind("Buy Line")==0 && linebuyfansuo==false)

                 {

                  if(shiftR)

                    {

                     if(buyline>Bid)

                       {

                        int aa1=OrderSend(Symbol(),OP_SELLLIMIT,CGetbuyLots(),buyline,0,0,0,NULL,0,0,CLR_NONE);

                        if(aa1>0)

                          {

                           Print("¢‹US÷S= ",aa1);

                           PlaySound("ok.wav");

                           comment("ÍS•UScUSbŸR");

                          }

                        else

                          {

                           PlaySound("timeout.wav");

                           comment("÷‹èlaBUYUS(u¢~¿~ÍS• SellUS(u݄¿~ÍS• ÍS•cUS1Y%");

                          }

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        shiftR=false;

                       }

                     else

                       {

                        int aa1=OrderSend(Symbol(),OP_SELLSTOP,CGetbuyLots(),buyline,0,0,0,NULL,0,0,CLR_NONE);

                        if(aa1>0)

                          {

                           Print("¢‹US÷S= ",aa1);

                           PlaySound("ok.wav");

                           comment("ÍS•UScUSbŸR");

                          }

                        else

                          {

                           PlaySound("timeout.wav");

                           comment("÷‹èlaBUYUS(u¢~¿~ÍS• SellUS(u݄¿~ÍS• ÍS•cUS1Y%");

                          }

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        shiftR=false;

                       }

                    }

                  else

                    {

                     linebuyfansuo=true;

                     linelock=true;

                     Print("æ‰ÊS*j¿~_ÓNÍS• _/T");

                     comment("æ‰ÊS*j¿~_ÓNÍS• _/T");

                    }

                 }

               else

                 {

                  if(linebuyfansuo)

                    {

                     linebuyfansuo=false;

                     linelock=false;

                     Print("æ‰ÊS*j¿~_ÓNÍS• sQí•");

                     comment("æ‰ÊS*j¿~_ÓNÍS• sQí•");

                    }

                 }

               if(ObjectFind("Sell Line")==0 && linesellfansuo==false)

                 {

                  if(shiftR)

                    {

                     if(sellline>Bid)

                       {

                        int aa2=OrderSend(Symbol(),OP_BUYSTOP,CGetsellLots(),sellline,0,0,0,NULL,0,0,CLR_NONE);

                        if(aa2>0)

                          {

                           Print("¢‹US÷S= ",aa2);

                           PlaySound("ok.wav");

                           comment("ÍS•UScUSbŸR");

                          }

                        else

                          {

                           PlaySound("timeout.wav");

                           comment("÷‹èlaBUYUS(u¢~¿~ÍS• SellUS(u݄¿~ÍS• ÍS•cUS1Y%");

                          }

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        shiftR=false;

                       }

                     else

                       {

                        int aa2=OrderSend(Symbol(),OP_BUYLIMIT,CGetsellLots(),sellline,0,0,0,NULL,0,0,CLR_NONE);

                        if(aa2>0)

                          {

                           Print("¢‹US÷S= ",aa2);

                           PlaySound("ok.wav");

                           comment("ÍS•UScUSbŸR");

                          }

                        else

                          {

                           PlaySound("timeout.wav");

                           comment("÷‹èlaBUYUS(u¢~¿~ÍS• SellUS(u݄¿~ÍS• ÍS•cUS1Y%");

                          }

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                        shiftR=false;

                       }

                    }

                  else

                    {

                     linesellfansuo=true;

                     linelock=true;

                     Print("æ‰ÊS*j¿~_ÓNÍS• _/T");

                     comment("æ‰ÊS*j¿~_ÓNÍS• _/T");

                    }

                 }

               else

                 {

                  if(linesellfansuo)

                    {

                     linesellfansuo=false;

                     linelock=false;

                     Print("æ‰ÊS*j¿~_ÓNÍS• sQí•");

                     comment("æ‰ÊS*j¿~_ÓNÍS• sQí•");

                    }

                 }

               lkey=false;

               fkey=false;

              }

            else

              {

               lkey=false;

              }

           }

         break;

         case 19://R jian

           {



           }

         break;

         case 30://A jian

           {

            if(linelock==false)

              {

               if(ctrltimeCurrent+20>=TimeCurrent())

                 {

                  Print("ctrl+AgbLˆ bar=",linebar01);

                  if(ObjectFind("Buy Line")==0)

                    {

                     comment(StringFormat("S_MRK¿~%G *j¿~(W_Øv÷N",linebar01+1));

                     double buyline1=Open[linebar01+1];

                     ObjectMove(0,"Buy Line",0,Time[linebar01+1],buyline1);

                     buyline=buyline1;

                     akey=false;

                    }

                  if(ObjectFind("Sell Line")==0)

                    {

                     comment(StringFormat("S_MRK¿~%G *j¿~(W_Øv÷N",linebar01+1));

                     double sellline1=Open[linebar01+1];

                     ObjectMove(0,"Sell Line",0,Time[linebar01+1],sellline1);

                     sellline=sellline1;

                     akey=false;

                    }

                  linebar01++;

                 }

               else

                 {

                  if(ctrlRtimeCurrent+20>=TimeCurrent())

                    {

                     Print("ctrlR+AgbLˆ bar=",linebar01+1);

                     comment(StringFormat("S_MRK¿~%G ¡‹—{gؚgNO„v-Nô•<PR¿~",linebar01+1));

                     if(ObjectFind("Buy Line")==0)

                       {

                        double buyline1=(Low[linebar01+1]+High[linebar01+1])/2;

                        ObjectMove(0,"Buy Line",0,Time[linebar01+1],buyline1);

                        buyline=buyline1;

                       }

                     if(ObjectFind("Sell Line")==0)

                       {

                        double sellline1=(Low[linebar01+1]+High[linebar01+1])/2;

                        ObjectMove(0,"Sell Line",0,Time[linebar01+1],sellline1);

                        sellline=sellline1;

                        akey=false;

                       }

                     linebar01++;

                    }

                  else

                    {

                     Print("AgbLˆ bar=",linebar01);

                     if(ObjectFind("Buy Line")==0)

                       {

                        comment(StringFormat("S_MRK¿~%G ¡‹—{gNO<PR¿~",linebar01+1));

                        double buyline1=Low[linebar01+1];

                        ObjectMove(0,"Buy Line",0,Time[linebar01+1],buyline1);

                        buyline=buyline1;

                        akey=false;

                       }

                     if(ObjectFind("Sell Line")==0)

                       {

                        comment(StringFormat("S_MRK¿~%G ¡‹—{gؚ<PR¿~",linebar01+1));

                        double sellline1=High[linebar01+1];

                        ObjectMove(0,"Sell Line",0,Time[linebar01+1],sellline1);

                        sellline=sellline1;

                        akey=false;

                       }

                     linebar01++;

                    }

                 }

              }

            else

              {

               Print("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

               comment("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

               akey=false;

              }

           }

         break;

         case 32://D jian

           {

            if(linelock==false)

              {

               if(ctrltimeCurrent+20>=TimeCurrent())

                 {

                  if(linebar01==0)

                     linebar01=1;

                  if(ObjectFind("Buy Line")==0)

                    {

                     Print("ctrl+DgbLˆ bar=",linebar01-1);

                     comment(StringFormat("S_MRK¿~%G *j¿~(W_Øv÷N ",linebar01-1));

                     double buyline2=Open[linebar01-1];

                     ObjectMove(0,"Buy Line",0,Time[linebar01-1],buyline2);

                     buyline=buyline2;

                     dkey=false;

                    }

                  if(ObjectFind("Sell Line")==0)

                    {

                     Print("ctrl+DgbLˆ bar=",linebar01-1);

                     comment(StringFormat("S_MRK¿~%G *j¿~(W_Øv÷N",linebar01-1));

                     double sellline2=Open[linebar01-1];

                     ObjectMove(0,"Sell Line",0,Time[linebar01-1],sellline2);

                     sellline=sellline2;

                     dkey=false;

                    }

                  linebar01--;

                 }

               else

                 {

                  if(ctrlRtimeCurrent+20>=TimeCurrent())

                    {

                     Print("ctrlR+DgbLˆ bar=",linebar01-1);

                     comment(StringFormat("S_MRK¿~%G ¡‹—{gؚgNO„v-Nô•<PR¿~",linebar01-1));

                     if(linebar01==0)

                        linebar01=1;

                     if(ObjectFind("Buy Line")==0)

                       {

                        double buyline2=(Low[linebar01-1]+High[linebar01-1])/2;

                        ObjectMove(0,"Buy Line",0,Time[linebar01-1],buyline2);

                        buyline=buyline2;

                        dkey=false;

                       }

                     if(ObjectFind("Sell Line")==0)

                       {

                        double sellline2=(Low[linebar01-1]+High[linebar01-1])/2;

                        ObjectMove(0,"Sell Line",0,Time[linebar01-1],sellline2);

                        sellline=sellline2;

                        dkey=false;

                       }

                     linebar01--;

                    }

                  else

                    {

                     if(linebar01==0)

                        linebar01=1;

                     if(ObjectFind("Buy Line")==0)

                       {

                        Print("DgbLˆ bar=",linebar01-1);

                        comment(StringFormat("S_MRK¿~%G ¡‹—{gNO<PR¿~",linebar01-1));

                        double buyline2=Low[linebar01-1];

                        ObjectMove(0,"Buy Line",0,Time[linebar01-1],buyline2);

                        buyline=buyline2;

                        dkey=false;

                       }

                     if(ObjectFind("Sell Line")==0)

                       {

                        Print("DgbLˆ bar=",linebar01-1);

                        comment(StringFormat("S_MRK¿~%G ¡‹—{gؚ<PR¿~",linebar01-1));

                        double sellline2=High[linebar01-1];

                        ObjectMove(0,"Sell Line",0,Time[linebar01-1],sellline2);

                        sellline=sellline2;

                        dkey=false;

                       }

                     linebar01--;

                    }

                 }

              }

            else

              {

               Print("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

               comment("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

               dkey=false;

              }

           }

         break;

         case 17://W jian

           {

            if(linelock==false)

              {

               if(ctrlRtimeCurrent+5>=TimeCurrent())

                 {

                  if(ObjectFind("Buy Line")==0)

                    {

                     ObjectMove(0,"Buy Line",0,Time[linebar],buyline+linepianyi*0.5*Point);

                     buyline=buyline+linepianyi*0.5*Point;

                    }

                  if(ObjectFind("Sell Line")==0)

                    {

                     ObjectMove(0,"Sell Line",0,Time[linebar],sellline+linepianyi*0.5*Point);

                     sellline=sellline+linepianyi*0.5*Point;

                    }

                 }

               else

                 {

                  if(ObjectFind("SL Line")==0)

                    {

                     if(ObjectFind("SL Line")==0)

                       {

                        ObjectMove(0,"SL Line",0,Time[linebar],slline+linepianyi*Point);

                        slline=slline+linepianyi*Point;

                       }

                    }

                  else

                    {

                     if(ObjectFind("Buy Line")==0)

                       {

                        ObjectMove(0,"Buy Line",0,Time[linebar],buyline+linepianyi*Point);

                        buyline=buyline+linepianyi*Point;

                       }

                     if(ObjectFind("Sell Line")==0)

                       {

                        ObjectMove(0,"Sell Line",0,Time[linebar],sellline+linepianyi*Point);

                        sellline=sellline+linepianyi*Point;

                       }

                    }

                 }

              }

            else

              {

               Print("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

               comment("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

              }

           }

         break;

         case 18://E jian

           {

            if(ObjectFind("Buy Line")==0)

              {

               buyline=NormalizeDouble(buyline,Digits-1);

               Print("*j¿~MOn
‚_gTNMO\pe");

               comment("*j¿~MOn
‚_gTNMO\pe");

              }

            if(ObjectFind("Sell Line")==0)

              {

               sellline=NormalizeDouble(sellline,Digits-1);

               Print("*j¿~MOn
‚_gTNMO\pe");

               comment("*j¿~MOn
‚_gTNMO\pe");

              }

           }

         break;

         case 48://B jian

           {



           }

         break;

         case 52://> jian YUSeR4Y®v

           {

            if(tabtimeCurrent+1>TimeCurrent() && Tickmode==false)

              {

               Tickmode=true;

               timeGMTSeconds1=SL5mtimeGMTSeconds1;

               GraduallyNum=SL5mlineGraduallyNum;

               stoploss=SL5mlinestoploss;

               takeprofit=SL5mlinetakeprofit;

               TrailingStop=SL5mlineTrailingStop;

               SL1mbuyLine=true;

               SL5mbuyLine=true;

               SL15mbuyLine=true;

               SLbuylinepingcang=true;

               bars097=3;//Shift &^bk_cNUS¡‹—{K¿~ÏQ\

               buypianyiliang=30;//  Shift &^bk_cNUSOPûyÏQ\

               sellpianyiliang=30;// Shift &^bk_cNUSOPûyÏQ\

               SL1mbuyLineprice=iLow(NULL,PERIOD_M1,iLowest(NULL,PERIOD_M1,MODE_LOW,SL1mlinetimeframe,0))-SLbuylinepianyi*Point;//RËYS

               SL5mbuyLineprice=iLow(NULL,PERIOD_M5,iLowest(NULL,PERIOD_M5,MODE_LOW,SL5mlinetimeframe,0))-SLbuylinepianyi*Point;

               SL5mbuyLineprice=iLow(NULL,PERIOD_M15,iLowest(NULL,PERIOD_M15,MODE_LOW,SL5mlinetimeframe,0))-SLbuylinepianyi*Point;

               SL1mbuyLineprice=Ask-500*Point;

               SL5mbuyLineprice=Ask-500*Point;

               SL15mbuyLineprice=Ask-500*Point;

               Print("TickReks^ÓN/T¨R YUS bkÈvbk_cò]îO9e:NeR4Y®v!j_");

               comment("TickReks^ÓN/T¨R YUS bkÈvbk_cò]îO9e:NeR4Y®v!j_");

               return;

              }

            else

              {

               if(tabtimeCurrent+1>TimeCurrent())

                 {

                  Tickmode=false;

                  timeGMTSeconds1=100;

                  GraduallyNum=5;

                  stoploss=320;

                  takeprofit=500;

                  TrailingStop=340;

                  SL1mbuyLine=false;

                  SL5mbuyLine=false;

                  SL15mbuyLine=false;

                  SLbuylinepingcang=false;

                  SL1msellLine=false;

                  SL5msellLine=false;

                  SL15msellLine=false;

                  SLselllinepingcang=false;

                  bars097=7;//Shift &^bk_cNUS¡‹—{K¿~ÏQ\

                  buypianyiliang=50;//  Shift &^bk_cNUSOPûyÏQ\

                  sellpianyiliang=50;// Shift &^bk_cNUSOPûyÏQ\



                  SLbuylineQpingcang=false;

                  SLselllineQpingcang=false;

                  SLbuylineQpingcangT=false;

                  SLselllineQpingcangT=false;

                  timeseconds=2;

                  if(ObjectFind(0,"SLsellQpengcangline")==0)

                     ObjectDelete(0,"SLsellQpengcangline");

                  if(ObjectFind(0,"SLbuyQpengcangline")==0)

                     ObjectDelete(0,"SLbuyQpengcangline");

                  if(ObjectFind(0,"SLsellQpengcangline1")==0)

                     ObjectDelete(0,"SLsellQpengcangline");

                  if(ObjectFind(0,"SLbuyQpengcangline1")==0)

                     ObjectDelete(0,"SLbuyQpengcangline");



                  if(ObjectFind(0,"SL1mbuyLine")==0)

                     ObjectDelete(0,"SL1mbuyLine");

                  if(ObjectFind(0,"SL5mbuyLine")==0)

                     ObjectDelete(0,"SL5mbuyLine");

                  if(ObjectFind(0,"SL15mbuyLine")==0)

                     ObjectDelete(0,"SL15mbuyLine");

                  if(ObjectFind(0,"SL1msellLine")==0)

                     ObjectDelete(0,"SL1msellLine");

                  if(ObjectFind(0,"SL5msellLine")==0)

                     ObjectDelete(0,"SL5msellLine");

                  if(ObjectFind(0,"SL15msellLine")==0)

                     ObjectDelete(0,"SL15msellLine");

                  if(ObjectFind(0,"botoupi")==0)

                     ObjectDelete(0,"botoupi");

                  Print("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                  comment("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                  return;

                 }

              }

            if(Tickmode)

              {

               if(SL1mbuyLine)

                 {

                  SL1mbuyLine=false;

                  SL1mbuyLineprice=Ask-1000*Point;

                  if(ObjectFind(0,"SL1mbuyLine")==0)

                     ObjectDelete(0,"SL1mbuyLine");

                  Print("NRŸ”bk_c*j¿~ÖSˆm ");

                  comment("NRŸ”bk_c*j¿~ÖSˆm");

                 }

               else

                 {

                  if(SL5mbuyLine)

                    {

                     SL5mbuyLine=false;

                     SL5mbuyLineprice=Ask-1000*Point;

                     if(ObjectFind(0,"SL5mbuyLine")==0)

                        ObjectDelete(0,"SL5mbuyLine");

                     Print("”NRŸ”bk_c*j¿~ÖSˆm ");

                     comment("”NRŸ”bk_c*j¿~ÖSˆm");

                    }

                  else



                    {

                     if(SL15mbuyLine)

                       {

                        SL15mbuyLine=false;

                        SL15mbuyLineprice=Ask-1000*Point;

                        if(ObjectFind(0,"SL15mbuyLine")==0)

                           ObjectDelete(0,"SL15mbuyLine");

                        Print("AS”NRŸ”bk_c*j¿~ÖSˆm ");

                        comment("AS”NRŸ”bk_c*j¿~ÖSˆm");

                       }

                     else

                       {

                        Tickmode=false;

                        timeGMTSeconds1=100;

                        GraduallyNum=5;

                        stoploss=320;

                        takeprofit=500;

                        TrailingStop=340;

                        SL1mbuyLine=false;

                        SL5mbuyLine=false;

                        SL15mbuyLine=false;

                        SLbuylinepingcang=false;

                        SL1msellLine=false;

                        SL5msellLine=false;

                        SL15msellLine=false;

                        SLselllinepingcang=false;

                        bars097=7;//Shift &^bk_cNUS¡‹—{K¿~ÏQ\

                        buypianyiliang=50;//  Shift &^bk_cNUSOPûyÏQ\

                        sellpianyiliang=50;// Shift &^bk_cNUSOPûyÏQ\

                        SLbuylineQpingcang=false;

                        SLselllineQpingcang=false;

                        SLbuylineQpingcangT=false;

                        SLselllineQpingcangT=false;

                        timeseconds=2;

                        if(ObjectFind(0,"SLsellQpengcangline")==0)

                           ObjectDelete(0,"SLsellQpengcangline");

                        if(ObjectFind(0,"SLbuyQpengcangline")==0)

                           ObjectDelete(0,"SLbuyQpengcangline");

                        if(ObjectFind(0,"SLsellQpengcangline1")==0)

                           ObjectDelete(0,"SLsellQpengcangline");

                        if(ObjectFind(0,"SLbuyQpengcangline1")==0)

                           ObjectDelete(0,"SLbuyQpengcangline");

                        if(ObjectFind(0,"SL1mbuyLine")==0)

                           ObjectDelete(0,"SL1mbuyLine");

                        if(ObjectFind(0,"SL5mbuyLine")==0)

                           ObjectDelete(0,"SL5mbuyLine");

                        if(ObjectFind(0,"SL15mbuyLine")==0)

                           ObjectDelete(0,"SL15mbuyLine");

                        if(ObjectFind(0,"SL1msellLine")==0)

                           ObjectDelete(0,"SL1msellLine");

                        if(ObjectFind(0,"SL5msellLine")==0)

                           ObjectDelete(0,"SL5msellLine");

                        if(ObjectFind(0,"SL15msellLine")==0)

                           ObjectDelete(0,"SL15msellLine");

                        if(ObjectFind(0,"botoupi")==0)

                           ObjectDelete(0,"botoupi");

                        Print("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                        comment("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                       }

                    }

                 }

              }

           }

         break;

         case 51://< jian zzUSeR4Y®v

           {

            if(tabtimeCurrent+1>=TimeCurrent() && Tickmode==false)

              {

               Tickmode=true;

               timeGMTSeconds1=SL5mtimeGMTSeconds1;

               GraduallyNum=SL5mlineGraduallyNum;

               stoploss=SL5mlinestoploss;

               takeprofit=SL5mlinetakeprofit;

               TrailingStop=SL5mlineTrailingStop;

               SL1msellLine=true;

               SL5msellLine=true;

               SL15msellLine=true;

               SLselllinepingcang=true;

               bars097=3;//Shift &^bk_cNUS¡‹—{K¿~ÏQ\

               buypianyiliang=30;//  Shift &^bk_cNUSOPûyÏQ\

               sellpianyiliang=30;// Shift &^bk_cNUSOPûyÏQ\

               SL1msellLineprice=iHigh(NULL,PERIOD_M1,iHighest(NULL,PERIOD_M1,MODE_HIGH,SL1mlinetimeframe,0))+SLselllinepianyi*Point;//RËYS

               SL5msellLineprice=iHigh(NULL,PERIOD_M5,iHighest(NULL,PERIOD_M5,MODE_HIGH,SL5mlinetimeframe,0))+SLselllinepianyi*Point;

               SL15msellLineprice=iHigh(NULL,PERIOD_M15,iHighest(NULL,PERIOD_M15,MODE_HIGH,SL15mlinetimeframe,0))+SLselllinepianyi*Point;

               SL1msellLineprice=Bid+500*Point;

               SL5msellLineprice=Bid+500*Point;

               SL15msellLineprice=Bid+500*Point;

               Print("TickReks^ÓN/T¨R zzUS bkÈvbk_cò]îO9e:NeR4Y®v!j_");

               comment("TickReks^ÓN/T¨R zzUS bkÈvbk_cò]îO9e:NeR4Y®v!j_");

               return;

              }

            else

              {

               if(tabtimeCurrent+1>=TimeCurrent())

                 {

                  Tickmode=false;

                  timeGMTSeconds1=100;

                  GraduallyNum=5;

                  stoploss=320;

                  takeprofit=500;

                  TrailingStop=340;

                  SL1mbuyLine=false;

                  SL5mbuyLine=false;

                  SL15mbuyLine=false;

                  SLbuylinepingcang=false;

                  SL1msellLine=false;

                  SL5msellLine=false;

                  SL15msellLine=false;

                  SLselllinepingcang=false;

                  bars097=7;//Shift &^bk_cNUS¡‹—{K¿~ÏQ\

                  buypianyiliang=50;//  Shift &^bk_cNUSOPûyÏQ\

                  sellpianyiliang=50;// Shift &^bk_cNUSOPûyÏQ\

                  SLbuylineQpingcang=false;

                  SLselllineQpingcang=false;

                  SLbuylineQpingcangT=false;

                  SLselllineQpingcangT=false;

                  timeseconds=2;

                  if(ObjectFind(0,"SLsellQpengcangline")==0)

                     ObjectDelete(0,"SLsellQpengcangline");

                  if(ObjectFind(0,"SLbuyQpengcangline")==0)

                     ObjectDelete(0,"SLbuyQpengcangline");

                  if(ObjectFind(0,"SLsellQpengcangline1")==0)

                     ObjectDelete(0,"SLsellQpengcangline");

                  if(ObjectFind(0,"SLbuyQpengcangline1")==0)

                     ObjectDelete(0,"SLbuyQpengcangline");

                  if(ObjectFind(0,"SL1mbuyLine")==0)

                     ObjectDelete(0,"SL1mbuyLine");

                  if(ObjectFind(0,"SL5mbuyLine")==0)

                     ObjectDelete(0,"SL5mbuyLine");

                  if(ObjectFind(0,"SL15mbuyLine")==0)

                     ObjectDelete(0,"SL15mbuyLine");

                  if(ObjectFind(0,"SL1msellLine")==0)

                     ObjectDelete(0,"SL1msellLine");

                  if(ObjectFind(0,"SL5msellLine")==0)

                     ObjectDelete(0,"SL5msellLine");

                  if(ObjectFind(0,"SL15msellLine")==0)

                     ObjectDelete(0,"SL15msellLine");

                  if(ObjectFind(0,"botoupi")==0)

                     ObjectDelete(0,"botoupi");

                  Print("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                  comment("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                  return;

                 }

              }

            if(Tickmode)

              {

               if(SL1msellLine)

                 {

                  SL1msellLine=false;

                  SL1msellLineprice=Bid+1000*Point;

                  if(ObjectFind(0,"SL1msellLine")==0)

                     ObjectDelete(0,"SL1msellLine");

                  Print("NRŸ”bk_c*j¿~ÖSˆm ");

                  comment("NRŸ”bk_c*j¿~ÖSˆm");

                 }

               else

                 {

                  if(SL5msellLine)

                    {

                     SL5msellLine=false;

                     SL5msellLineprice=Bid+1000*Point;

                     if(ObjectFind(0,"SL5msellLine")==0)

                        ObjectDelete(0,"SL5msellLine");

                     Print("”NRŸ”bk_c*j¿~ÖSˆm ");

                     comment("”NRŸ”bk_c*j¿~ÖSˆm");

                    }

                  else

                    {

                     if(SL15msellLine)

                       {

                        SL15msellLine=false;

                        SL15msellLineprice=Bid+1000*Point;

                        if(ObjectFind(0,"SL15msellLine")==0)

                           ObjectDelete(0,"SL15msellLine");

                        Print("AS”NRŸ”bk_c*j¿~ÖSˆm ");

                        comment("AS”NRŸ”bk_c*j¿~ÖSˆm");

                       }

                     else

                       {

                        Tickmode=false;

                        timeGMTSeconds1=100;

                        GraduallyNum=5;

                        stoploss=320;

                        takeprofit=500;

                        TrailingStop=340;

                        SL1mbuyLine=false;

                        SL5mbuyLine=false;

                        SL15mbuyLine=false;

                        SLbuylinepingcang=false;

                        SL1msellLine=false;

                        SL5msellLine=false;

                        SL15msellLine=false;

                        SLselllinepingcang=false;

                        bars097=7;//Shift &^bk_cNUS¡‹—{K¿~ÏQ\

                        buypianyiliang=50;//  Shift &^bk_cNUSOPûyÏQ\

                        sellpianyiliang=50;// Shift &^bk_cNUSOPûyÏQ\

                        SLbuylineQpingcang=false;

                        SLselllineQpingcang=false;

                        SLbuylineQpingcangT=false;

                        SLselllineQpingcangT=false;

                        timeseconds=2;

                        if(ObjectFind(0,"SLsellQpengcangline")==0)

                           ObjectDelete(0,"SLsellQpengcangline");

                        if(ObjectFind(0,"SLbuyQpengcangline")==0)

                           ObjectDelete(0,"SLbuyQpengcangline");

                        if(ObjectFind(0,"SLsellQpengcangline1")==0)

                           ObjectDelete(0,"SLsellQpengcangline");

                        if(ObjectFind(0,"SLbuyQpengcangline1")==0)

                           ObjectDelete(0,"SLbuyQpengcangline");

                        if(ObjectFind(0,"SL1mbuyLine")==0)

                           ObjectDelete(0,"SL1mbuyLine");

                        if(ObjectFind(0,"SL5mbuyLine")==0)

                           ObjectDelete(0,"SL5mbuyLine");

                        if(ObjectFind(0,"SL15mbuyLine")==0)

                           ObjectDelete(0,"SL15mbuyLine");

                        if(ObjectFind(0,"SL1msellLine")==0)

                           ObjectDelete(0,"SL1msellLine");

                        if(ObjectFind(0,"SL5msellLine")==0)

                           ObjectDelete(0,"SL5msellLine");

                        if(ObjectFind(0,"SL15msellLine")==0)

                           ObjectDelete(0,"SL15msellLine");

                        if(ObjectFind(0,"botoupi")==0)

                           ObjectDelete(0,"botoupi");

                        Print("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                        comment("TickReks^ÓNsQí•  bkÈvbk_cò]îO9e:Nck8^!j_");

                       }

                    }

                 }

              }

           }

         break;

         case 16://Q jian

           {

            if(ObjectFind(0,"Sell Line")==0)

              {

               ObjectDelete(0,"Sell Line");

               ObjectDelete(0,"SL Line");

               linebar01=linebar;

               linebuykaicang=false;

               linebuypingcang=false;

               linebuyfansuo=false;

               linesellkaicang=false;

               linesellpingcang=false;

               linesellfansuo=false;

               linelock=false;

               lkey=false;

               linebuyzidongjiacang=false;

               linesellzidongjiacang=false;

               linebuypingcangR=false;

               linesellpingcangR=false;

               linebuypingcangC=false;

               linesellpingcangC=false;

               linebuypingcangctrlR=false;

               linesellpingcangctrlR=false;

               linekaicangT=false;

               timeseconds1=timeseconds1P;

               pingcangdingdanshu=1000;

               return;

              }

            if(ObjectFind("Buy Line")==0)

              {

               ObjectDelete(0,"Buy Line");

               sellline=High[iHighest(NULL,0,MODE_HIGH,linebar,0)];

               SetLevel("Sell Line",sellline,ForestGreen);

               selllineOnTimer=Bid;

              }

            else

              {

               if(ObjectFind(0,"Sell Line")==0)

                  ObjectDelete(0,"Sell Line");

               buyline=Low[iLowest(NULL,0,MODE_LOW,linebar,0)];

               SetLevel("Buy Line",buyline,Red);

               buylineOnTimer=Bid;

              }

           }

         break;

         case 45://X jian

           {

            if(ObjectFind("SL Line")==0)

              {

               ObjectDelete(0,"SL Line");

              }

            else

              {

               if(ObjectFind("Buy Line")==0)

                 {

                  slline=buyline-70*Point;

                  SetLevel("SL Line",slline,FireBrick);

                 }

               if(ObjectFind("Sell Line")==0)

                 {

                  slline=sellline+70*Point;

                  SetLevel("SL Line",slline,FireBrick);

                 }

              }

           }

         break;

         case 31://S jian

           {

            if(linelock==false)

              {

               if(ctrlRtimeCurrent+5>=TimeCurrent())

                 {

                  if(ObjectFind("Buy Line")==0)

                    {

                     ObjectMove(0,"Buy Line",0,Time[linebar],buyline-linepianyi*0.5*Point);

                     buyline=buyline-linepianyi*0.5*Point;

                     skey=false;

                    }

                  if(ObjectFind("Sell Line")==0)

                    {

                     ObjectMove(0,"Sell Line",0,Time[linebar],sellline-linepianyi*0.5*Point);

                     sellline=sellline-linepianyi*0.5*Point;

                     skey=false;

                    }

                 }

               else

                 {

                  if(ObjectFind("SL Line")==0)

                    {

                     if(ObjectFind("SL Line")==0)

                       {

                        ObjectMove(0,"SL Line",0,Time[linebar],slline-linepianyi*Point);

                        slline=slline-linepianyi*Point;

                        skey=false;

                       }

                    }

                  else

                    {

                     if(ObjectFind("Buy Line")==0)

                       {

                        ObjectMove(0,"Buy Line",0,Time[linebar],buyline-linepianyi*Point);

                        buyline=buyline-linepianyi*Point;

                        skey=false;

                       }

                     if(ObjectFind("Sell Line")==0)

                       {

                        ObjectMove(0,"Sell Line",0,Time[linebar],sellline-linepianyi*Point);

                        sellline=sellline-linepianyi*Point;

                        skey=false;

                       }

                    }

                 }

              }

            else

              {

               Print("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

               comment("àeÕlûy¨R*j¿~ S_MR	gûN¡R(WÑv§c-N ÷‹HQsQí•øv”^_sQ");

              }



            if(gtimeCurrent+1>=TimeCurrent() && gkey==true)

              {

               Print("g=",gkey," s=",skey," zfý€selllimitUS Yt-N. . .");

               comment(" zfý€selllimitUS Yt-N. . .");

               zhinengguadanselllimit();

               gkey=false;

               skey=false;

              }

            else

               gkey=false;

           }

         break;

         case 44://Z jian

           {

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               if(shiftRtimeCurrent+3>=TimeCurrent())

                 {

                  if(ObjectFind("Buy Line")==0)

                    {

                     if(buyline<Ask && GetHoldingbuyOrdersCount()>0)

                       {

                        Print("buyline=",NormalizeDouble(buyline,Digits));

                        Print("BuyUS*j¿~Y¾‹nß~Nbk_c Yt-N... ");

                        comment("BuyUS*j¿~Y¾‹nß~Nbk_c Yt-N...");

                        PiliangSL(true,NormalizeDouble(buyline,Digits),0,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("¢~¿~Y(WS_MR÷N
N¹e BuyUSàeÕl¾‹nbk_c b¡l	gBuyUS ");

                        comment("¢~¿~Y(WS_MR÷N
N¹e BuyUSàeÕl¾‹nbk_c b¡l	gBuyUS");

                       }

                    }

                  if(ObjectFind("Sell Line")==0)

                    {

                     if(sellline>Bid && GetHoldingsellOrdersCount()>0)

                       {

                        Print("sellline=",NormalizeDouble(sellline,Digits));

                        Print("SellUS*j¿~Y¾‹nß~Nbk_c Yt-N... ");

                        comment("SellUS*j¿~Y¾‹nß~Nbk_c Yt-N...");

                        PiliangSL(false,NormalizeDouble(sellline,Digits),0,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("ÿ~¿~Y(WS_MR÷NN¹e SellUSàeÕl¾‹nbk_c b¡l	gsellUS ");

                        comment("ÿ~¿~Y(WS_MR÷NN¹e SellUSàeÕl¾‹nbk_c b¡l	gsellUS");

                       }

                    }

                 }

               else

                 {

                  if(ObjectFind("Buy Line")==0)

                    {

                     if(buyline<Ask && GetHoldingbuyOrdersCount()>0)

                       {

                        Print("buyline=",NormalizeDouble(buyline,Digits));

                        Print("BuyUS*j¿~Y¾‹nbk_c Yt-N... ");

                        comment("BuyUS*j¿~Y¾‹nbk_c Yt-N...");

                        PiliangSL(true,NormalizeDouble(buyline,Digits),jianju07,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("¢~¿~Y(WS_MR÷N
N¹e BuyUSàeÕl¾‹nbk_c b¡l	gsellUS ");

                        comment("¢~¿~Y(WS_MR÷N
N¹e BuyUSàeÕl¾‹nbk_c b¡l	gsellUS");

                       }

                    }

                  if(ObjectFind("Sell Line")==0)

                    {

                     if(sellline>Bid && GetHoldingsellOrdersCount()>0)

                       {

                        Print("sellline=",NormalizeDouble(sellline,Digits));

                        Print("SellUS*j¿~Y¾‹nbk_c Yt-N... ");

                        comment("SellUS*j¿~Y¾‹nbk_c Yt-N...");

                        PiliangSL(false,NormalizeDouble(sellline,Digits),jianju07,0,juxianjia07,dingdanshu);

                        if(ObjectFind(0,"Buy Line")==0)

                           ObjectDelete(0,"Buy Line");

                        if(ObjectFind(0,"Sell Line")==0)

                           ObjectDelete(0,"Sell Line");

                       }

                     else

                       {

                        PlaySound("timeout.wav");

                        Print("ÿ~¿~Y(WS_MR÷NN¹e SellUSàeÕl¾‹nbk_c b¡l	gsellUS ");

                        comment("ÿ~¿~Y(WS_MR÷NN¹e SellUSàeÕl¾‹nbk_c b¡l	gsellUS");

                       }

                    }

                 }

               lkey=false;

               zkey=false;

              }

            else

              {

               lkey=false;

               if(shiftRtimeCurrent+3>=TimeCurrent())

                 {

                  if(ObjectFind("SL15mbuyLine")==0)

                    {

                     Print("15RŸ”*j¿~Y¾‹nbk_c Yt-N... ");

                     comment("15RŸ”*j¿~Y¾‹nbk_c Yt-N...");

                     PiliangSL(true,NormalizeDouble(SL15mbuyLineprice,Digits),jianju07,0,juxianjia07,dingdanshu);

                    }

                  if(ObjectFind("SL15msellLine")==0)

                    {

                     Print("15RŸ”*j¿~Y¾‹nbk_c Yt-N... ");

                     comment("15RŸ”*j¿~Y¾‹nbk_c Yt-N...");

                     PiliangSL(false,NormalizeDouble(SL15msellLineprice,Digits),jianju07,0,juxianjia07,dingdanshu);

                    }

                 }

               else

                 {

                  if(ObjectFind("SL5mbuyLine")==0)

                    {

                     Print("5RŸ”*j¿~Y¾‹nbk_c Yt-N... ");

                     comment("5RŸ”*j¿~Y¾‹nbk_c Yt-N...");

                     PiliangSL(true,NormalizeDouble(SL5mbuyLineprice,Digits),jianju07,0,juxianjia07,dingdanshu);

                    }

                  if(ObjectFind("SL5msellLine")==0)

                    {

                     Print("5RŸ”*j¿~Y¾‹nbk_c Yt-N... ");

                     comment("5RŸ”*j¿~Y¾‹nbk_c Yt-N...");

                     PiliangSL(false,NormalizeDouble(SL5msellLineprice,Digits),jianju07,0,juxianjia07,dingdanshu);

                    }

                 }

              }

           }

         break;

         case 36://J jian

           {

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUS¡‹—{gя",bars10,"9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment(StringFormat("YUS¡‹—{gя%G9hK¿~ybϑzfý€bk_c Yt-N . . . ",bars10));

               PiliangSL(true,GetiLowest(timeframe10,bars10,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10,juxianjia10,dingdanshu1);

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUS¡‹—{gя",bars10,"9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment(StringFormat("zzUS¡‹—{gя%G9hK¿~ybϑzfý€bk_c Yt-N . . . ",bars10));

               PiliangSL(false,GetiHighest(timeframe10,bars10,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10,juxianjia10,dingdanshu1);

               skey=false;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print(" v=",vkey,"YUSzfý€¾‹nß~Nbk_cMO Yt-N . . .");

               comment("YUSzfý€¾‹nß~Nbk_cMO Yt-N . . . ");

               PiliangSL(true,GetiLowest(timeframe06,bars06,beginbar06)-MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju06,pianyiliang06,juxianjia06,dingdangeshu06);

               vkey=false;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print(" a=",akey,"zzUSzfý€¾‹nß~Nbk_cMO Yt-N . . .");

               comment("zzUSzfý€¾‹nß~Nbk_cMO Yt-N . . . ");

               PiliangSL(false,GetiHighest(timeframe06,bars06,beginbar06)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju06,pianyiliang06,juxianjia06,dingdangeshu06);

               akey=false;

              }

            else

               akey=false;

           }

         break;

         case 37://K jian

           {

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               if(ObjectFind("Buy Line")==0 && linebuykaicang==false)

                 {

                  if(shiftR)

                    {

                     linekaicangshiftR=true;

                     linebuykaicang=true;

                     huaxiankaicanggeshuR1=huaxiankaicanggeshuR+rightpress;

                     timeseconds1=timeseconds1P+leftpress;

                     linelock=true;

                     Print("æ‰ÊS*j¿~_BuyUS _/T ÂS€÷N<hŒTöeô• _ÓN",huaxiankaicanggeshuR1,"!k");

                     comment(StringFormat("æ‰ÊS*j¿~_BuyUS _/T ŠÇ÷N<h%G_ÓN ô•”–%GÒy _ÓN%G!k",buyline,timeseconds1,huaxiankaicanggeshuR1));

                     shiftR=false;

                    }

                  else

                    {

                     if(ObjectFind(0,"SL Line")==0)

                       {

                        linebuykaicang=true;

                        linekaicangT=true;

                        huaxiankaicanggeshuT1=huaxiankaicanggeshuT+rightpress;

                        timeseconds1=timeseconds1P+leftpress;

                        linelock=true;

                        Print("æ‰ÊS*j¿~_BuyUSbk_c¿~bk_c _/T ÂS€öeô•ŒT÷NMO _ÓN",huaxiankaicanggeshuT1,"!k");

                        comment(StringFormat("æ‰ÊS*j¿~_BuyUSbk_c¿~bk_c _/T ÂS€öeô•ŒT÷NMO _ÓN%G!k",huaxiankaicanggeshuT1));

                       }

                     else

                       {

                        linebuykaicang=true;

                        huaxiankaicanggeshu1=huaxiankaicanggeshu+rightpress;

                        timeseconds1=timeseconds1P+leftpress;

                        linelock=true;

                        Print("æ‰ÊS*j¿~_BuyUS _/T êSÂS€öeô• _ÓN",huaxiankaicanggeshu1,"!k");

                        comment(StringFormat("æ‰ÊS*j¿~_BuyUS _/T êSÂS€öeô•_ÓNô•”–%GÒy _ÓN%G!k",timeseconds1,huaxiankaicanggeshu1));

                       }



                    }

                 }

               else

                 {

                  if(linebuykaicang)

                    {

                     linebuykaicang=false;

                     linekaicangshiftR=false;

                     linekaicangT=false;

                     huaxiankaicanggeshuR1=huaxiankaicanggeshuR;

                     huaxiankaicanggeshu1=huaxiankaicanggeshu;

                     huaxiankaicanggeshuT1=huaxiankaicanggeshuT;

                     timeseconds1=timeseconds1P;

                     linelock=false;

                     Print("æ‰ÊS*j¿~_BuyUS sQí•");

                     comment("æ‰ÊS*j¿~_BuyUS sQí•");

                    }

                 }

               if(ObjectFind("Sell Line")==0 && linesellkaicang==false)

                 {

                  if(shiftR)

                    {

                     linekaicangshiftR=true;

                     linesellkaicang=true;

                     huaxiankaicanggeshuR1=huaxiankaicanggeshuR+rightpress;

                     timeseconds1=timeseconds1P+leftpress;

                     linelock=true;

                     Print("æ‰ÊS*j¿~_SellUS _/T ÂS€÷N<hŒTöeô• _ÓN",huaxiankaicanggeshuR1,"!k");

                     comment(StringFormat("æ‰ÊS*j¿~_SellUS _/T ŠÇ÷N<h%G_ÓN ô•”–%GÒy _ÓN%G!k",sellline,timeseconds1,huaxiankaicanggeshuR1));

                     shiftR=false;

                    }

                  else

                    {

                     if(ObjectFind(0,"SL Line")==0)

                       {

                        linesellkaicang=true;

                        linekaicangT=true;

                        huaxiankaicanggeshuT1=huaxiankaicanggeshuT+rightpress;

                        timeseconds1=timeseconds1P+leftpress;

                        linelock=true;

                        Print("æ‰ÊS*j¿~_SellUSbk_c¿~bk_c _/T ÂS€öeô•ŒT÷N<h _ÓN",huaxiankaicanggeshuT1,"!k");

                        comment(StringFormat("æ‰ÊS*j¿~_SellUSbk_c¿~bk_c _/T ÂS€öeô•ŒT÷N<h _ÓN%G!k",huaxiankaicanggeshuT1));

                       }

                     else

                       {

                        linesellkaicang=true;

                        huaxiankaicanggeshu1=huaxiankaicanggeshu+rightpress;

                        timeseconds1=timeseconds1P+leftpress;

                        linelock=true;

                        Print("æ‰ÊS*j¿~_SellUS _/T êSÂS€öeô• _ÓN",huaxiankaicanggeshu1,"!k");

                        comment(StringFormat("æ‰ÊS*j¿~_SellUS _/T êSÂS€öeô•_ÓNô•”–%GÒy _ÓN%G!k",timeseconds1,huaxiankaicanggeshu1));

                       }

                    }

                 }

               else

                 {

                  if(linesellkaicang)

                    {

                     linesellkaicang=false;

                     linekaicangshiftR=false;

                     linekaicangT=false;

                     huaxiankaicanggeshuR1=huaxiankaicanggeshuR;

                     huaxiankaicanggeshu1=huaxiankaicanggeshu;

                     huaxiankaicanggeshuT1=huaxiankaicanggeshuT;

                     timeseconds1=timeseconds1P;

                     linelock=false;

                     Print("æ‰ÊS*j¿~_SellUS sQí•");

                     comment("æ‰ÊS*j¿~_SellUS sQí•");

                    }

                 }

               lkey=false;

               kkey=false;

              }

            else

              {

               lkey=false;

              }

           }

         break;

         case 23://I j

           {

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUS¡‹—{gя",bars10,"9hK¿~ybϑzfý€bkÈv Yt-N . . .");

               comment(StringFormat("YUS¡‹—{gя%G9hK¿~ybϑzfý€bkÈv Yt-N . . . ",bars10));

               PiliangTP(true,GetiHighest(timeframe10,bars10,beginbar10)+press(),jianju10tp,pianyiliang10tp,juxianjia10,dingdanshu1);

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUS¡‹—{gя",bars10,"9hK¿~ybϑzfý€bkÈv Yt-N . . .");

               comment(StringFormat("zzUS¡‹—{gя%G9hK¿~ybϑzfý€bkÈv Yt-N . . . ",bars10));

               PiliangTP(false,GetiLowest(timeframe10,bars10,beginbar10)+(MarketInfo(Symbol(),MODE_SPREAD)+selltp10)*Point+press(),jianju10tp,pianyiliang10tp,juxianjia10,dingdanshu1);

               skey=false;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print(" v=",vkey,"YUSzfý€¾‹nß~NbkÈvMO Yt-N . . .");

               comment("YUSzfý€¾‹nß~NbkÈvMO Yt-N . . . ");

               PiliangTP(true,GetiHighest(timeframe06,bars06,beginbar06)+press(),jianju06,pianyiliang06tp,juxianjia06,dingdangeshu06);

               vkey=false;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print(" a=",akey,"zzUSzfý€¾‹nß~NbkÈvMO Yt-N . . .");

               comment("zzUSzfý€¾‹nß~NbkÈvMO Yt-N . . . ");

               PiliangTP(false,GetiLowest(timeframe06,bars06,beginbar06)+(MarketInfo(Symbol(),MODE_SPREAD)+selltp06)*Point+press(),jianju06,pianyiliang06tp,juxianjia06,dingdangeshu06);

               akey=false;

              }

            else

               akey=false;

           }

         break;

         case 22://U j

           {

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUS¡‹—{gя",bars1010,"9hK¿~ybϑzfý€bkÈv Yt-N . . .");

               comment(StringFormat("YUS¡‹—{gя%G9hK¿~ybϑzfý€bkÈv Yt-N . . . ",bars1010));

               PiliangTP(true,GetiHighest(timeframe10,bars1010,beginbar10)+press(),jianju10tp,pianyiliang10tp,juxianjia10,dingdanshu1);

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUS¡‹—{gя",bars1010,"9hK¿~ybϑzfý€bkÈv Yt-N . . .");

               comment(StringFormat("zzUS¡‹—{gя%G9hK¿~ybϑzfý€bkÈv Yt-N . . . ",bars1010));

               PiliangTP(false,GetiLowest(timeframe10,bars1010,beginbar10)+(MarketInfo(Symbol(),MODE_SPREAD)+selltp10)*Point+press(),jianju10tp,pianyiliang10tp,juxianjia10,dingdanshu1);

               skey=false;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey," YUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
NÏQ»S¹pî]Q R
N",pianyiliang05tp,"¹pbkÈv Yt-N . . .");

               comment(StringFormat("YUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
NÏQ»S¹pî]QÏQ»S%G¹pbkÈv Yt-N . . .",pianyiliang05tp));

               PiliangTP(true,GetiHighest(timeframe05,bars05,beginbar05)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju05,pianyiliang05tp,juxianjia05,dingdangeshu05);

               vkey=false;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey," zzUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
N R
N¹pî]Q R
N",pianyiliang05tp,"¹pbkÈv Yt-N . . .");

               comment(StringFormat("zzUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
N R
N¹pî]Q R
N%G¹pbkÈv Yt-N . . .",pianyiliang05tp));

               PiliangTP(false,GetiLowest(timeframe05,bars05,beginbar05)+MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju05,pianyiliang05tp,juxianjia05,dingdangeshu05);

               akey=false;

              }

            else

               akey=false;

           }

         break;

         case 35://H j

           {

            if(ltimeCurrent+2>=TimeCurrent() && lkey==true)

              {

               if(ObjectFind("Buy Line")==0 && linebuyzidongjiacang==false)

                 {

                  if(shiftR)

                    {

                     /*

                                          linekaicangshiftR=true;

                                          linebuykaicang=true;

                                          linelock=true;

                                          Print("æ‰ÊS*j¿~_BuyUS _/T êSÂS€÷N<h");

                                          comment("æ‰ÊS*j¿~_BuyUS _/T êSÂS€÷N<h");

                                          shiftR=false;*/

                    }

                  else

                    {

                     linebuyzidongjiacang=true;

                     linelock=true;

                     Print("”NRŸ”ꁨR RÓNBuyUS _/T ");

                     comment("”NRŸ”ꁨR RÓNBuyUS _/T ");

                    }

                 }

               else

                 {

                  if(linebuyzidongjiacang)

                    {

                     linebuyzidongjiacang=false;

                     linelock=false;

                     huaxianzidongjiacanggeshu1=huaxianzidongjiacanggeshu;

                     huaxianzidongjiacanggeshutime1=huaxianzidongjiacanggeshutime;

                     lineTime=false;

                     linetime=0;

                     linefirsttime=true;

                     Print("”NRŸ”ꁨR RÓNBuyUS sQí•");

                     comment("”NRŸ”ꁨR RÓNBuyUS sQí•");

                     if(ObjectFind(0,"Buy Line")==0)

                        ObjectDelete(0,"Buy Line");

                     if(ObjectFind(0,"Sell Line")==0)

                        ObjectDelete(0,"Sell Line");

                    }

                 }

               if(ObjectFind("Sell Line")==0 && linesellkaicang==false)

                 {

                  if(shiftR)

                    {

                     /*

                                          linekaicangshiftR=true;

                                          linesellkaicang=true;

                                          linelock=true;

                                          Print("æ‰ÊS*j¿~_SellUS _/T êSÂS€÷N<h");

                                          comment("æ‰ÊS*j¿~_SellUS _/T êSÂS€÷N<h");

                                          shiftR=false;*/

                    }

                  else

                    {

                     linesellzidongjiacang=true;

                     linelock=true;

                     Print("”NRŸ”ꁨR RÓNSellUS _/T");

                     comment("”NRŸ”ꁨR RÓNSellUS _/T");

                    }

                 }

               else

                 {

                  if(linesellzidongjiacang)

                    {

                     linesellzidongjiacang=false;

                     linelock=false;

                     Print("”NRŸ”ꁨR RÓNSellUS sQí•");

                     comment("”NRŸ”ꁨR RÓNSellUS sQí•");

                     huaxianzidongjiacanggeshu1=huaxianzidongjiacanggeshu;

                     huaxianzidongjiacanggeshutime1=huaxianzidongjiacanggeshutime;

                     lineTime=false;

                     linetime=0;

                     linefirsttime=true;

                     if(ObjectFind(0,"Buy Line")==0)

                        ObjectDelete(0,"Buy Line");

                     if(ObjectFind(0,"Sell Line")==0)

                        ObjectDelete(0,"Sell Line");

                    }

                 }

               lkey=false;

              }

            else

              {

               lkey=false;

              }

            if(btimeCurrent+2>=TimeCurrent() && bkey==true)

              {

               Print("b=",bkey,"YUS¡‹—{gя",bars1010,"9hK¿~ybϑzfý€bk_c Yt-N . . . ");

               comment(StringFormat("YUS¡‹—{gя%G9hK¿~ybϑzfý€bk_c Yt-N . . . ",bars1010));

               PiliangSL(true,GetiLowest(timeframe10,bars1010,beginbar10)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju10,pianyiliang10,juxianjia10,dingdanshu1);

               bkey=false;

              }

            else

               bkey=false;

            if(stimeCurrent+2>=TimeCurrent() && skey==true)

              {

               Print("s=",skey,"zzUS¡‹—{gя",bars1010,"9hK¿~ybϑzfý€bk_c Yt-N . . .");

               comment(StringFormat("zzUS¡‹—{gя%G9hK¿~ybϑzfý€bk_c Yt-N . . . ",bars1010));

               PiliangSL(false,GetiHighest(timeframe10,bars1010,beginbar10)+MarketInfo(Symbol(),MODE_SPREAD)*2*Point+press(),jianju10,pianyiliang10,juxianjia10,dingdanshu1);

               skey=false;

              }

            else

               skey=false;

            if(vtimeCurrent+2>=TimeCurrent() && vkey==true)

              {

               Print("v=",vkey," YUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
NÏQ»S¹pî]QÏQ»S",pianyiliang05,"¹pbk_c Yt-N . . .");

               comment(StringFormat("YUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
NÏQ»S¹pî]QÏQ»S%G¹pbk_c Yt-N . . .",pianyiliang05));

               PiliangSL(true,GetiLowest(timeframe05,bars05,beginbar05)-MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju05,pianyiliang05,juxianjia05,dingdangeshu05);

               vkey=false;

              }

            else

               vkey=false;

            if(atimeCurrent+2>=TimeCurrent() && akey==true)

              {

               Print("a=",akey," zzUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
N R
N¹pî]Q R
N",pianyiliang05,"¹pbk_c Yt-N . . .");

               comment(StringFormat("zzUSybϑzfý€¡‹—{(WÓ~œg„vúW@x
N R
N¹pî]Q R
N%G¹pbk_c Yt-N . . .",pianyiliang05));

               PiliangSL(false,GetiHighest(timeframe05,bars05,beginbar05)+MarketInfo(Symbol(),MODE_SPREAD)*Point+press(),jianju05,pianyiliang05,juxianjia05,dingdangeshu05);

               akey=false;

              }

            else

               akey=false;

           }

         break;

         case 53://"? / .•"

           {

            huaxianguadanlotsT=MathFloor(huaxianguadanlots*0.5/MarketInfo(Symbol(),MODE_LOTSTEP))*MarketInfo(Symbol(),MODE_LOTSTEP);

            keylotshalf=keylotshalfT;

            Print("cUS؞¤‹ÓNMOÏQJS ,gÐc:yˆm1YÓNMOb`
Y");

            comment(StringFormat("cUS؞¤‹ÓNMOÏQJS %G Kb ,gÐc:yˆm1YÓNMOb`
Y ",huaxianguadanlotsT));

           }

         break;

         case 83://\.•Øv \pe¹p

           {

            if(holdingtime==holdingtimemin)

              {

               holdingtime=holdingtimemax;

               Print("NUSꁨR¡‹—{&^bk_c •öeô•	gHe");

               comment("NUSꁨR¡‹—{&^bk_c •öeô•	gHe");

              }

            else

              {

               holdingtime=holdingtimemin;

               Print("NUSꁨR¡‹—{&^bk_c íwöeô•	gHe");

               comment("NUSꁨR¡‹—{&^bk_c íwöeô•	gHe");

              }

           }

         break;

         default:

            break;

        }

      if(StrToInteger(sparam)==buykey)//^÷NpNNUS

        {

         if(shifttimeCurrent+holdingtime>=TimeCurrent())

           {

            buysellnowSL(true,keylotshalf,timeframe09,bars097,beginbar09,buypianyiliang);

           }

         else

           {

            if(buymaxTotallots)

              {

               Print("YUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               comment("YUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               PlaySound("timeout.wav");

               return;

              }

            Print("^÷NpNNUS Yt-N . . .");

            comment("^÷NpNNUS Yt-N . . .");

            int keybuy=OrderSend(Symbol(),OP_BUY,keylots,Ask,keyslippage,0,0,NULL,0,0);

            if(keybuy>0)

               PlaySound("ok.wav");

            else

              {

               PlaySound("timeout.wav");

               Print("GetLastError=",GetLastError());

              }

           }

        }

      if(StrToInteger(sparam)==sellkey)

        {

         if(shifttimeCurrent+holdingtime>=TimeCurrent())

           {

            buysellnowSL(false,keylotshalf,timeframe09,bars097,beginbar09,sellpianyiliang);

           }

         else

           {

            if(sellmaxTotallots)

              {

               Print("zzUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               comment("zzUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               PlaySound("timeout.wav");

               return;

              }

            Print("^÷NVSNUS Yt-N . . .");

            comment("^÷NVSNUS Yt-N . . .");

            int keysell=OrderSend(Symbol(),OP_SELL,keylots,Bid,keyslippage,0,0,NULL,0,0);

            if(keysell>0)

               PlaySound("ok.wav");

            else

              {

               PlaySound("timeout.wav");

               Print("GetLastError=",GetLastError());

              }

           }

        }

      if(StrToInteger(sparam)==buykeydouble)

        {

         if(shifttimeCurrent+holdingtime>=TimeCurrent())

           {

            buysellnowSL(true,keylotshalf*2,timeframe09,bars097,beginbar09,buypianyiliang);

           }

         else

           {

            if(buymaxTotallots)

              {

               Print("YUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               comment("YUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               PlaySound("timeout.wav");

               return;

              }

            Print("^÷NÌS
PpNNUS Yt-N . . .");

            comment("^÷NÌS
PpNNUS Yt-N . . .");

            int keybuy=OrderSend(Symbol(),OP_BUY,keylots*2,Ask,keyslippage,0,0,NULL,0,0);

            if(keybuy>0)

               PlaySound("ok.wav");

            else

               PlaySound("timeout.wav");

           }

        }

      if(StrToInteger(sparam)==sellkeydouble)

        {

         if(shifttimeCurrent+holdingtime>=TimeCurrent())

           {

            buysellnowSL(false,keylotshalf*2,timeframe09,bars097,beginbar09,sellpianyiliang);

           }

         else

           {

            if(sellmaxTotallots)

              {

               Print("zzUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               comment("zzUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               PlaySound("timeout.wav");

               return;

              }

            Print("^÷NÌS
PVSNUS Yt-N . . .");

            comment("^÷NÌS
PVSNUS Yt-N . . .");

            int keysell=OrderSend(Symbol(),OP_SELL,keylots*2,Bid,keyslippage,0,0,NULL,0,0);

            if(keysell>0)

               PlaySound("ok.wav");

            else

               PlaySound("timeout.wav");

           }

        }

      if(StrToInteger(sparam)==buykey3)

        {

         if(shifttimeCurrent+holdingtime>=TimeCurrent())

           {

            buysellnowSL(true,keylotshalf*3,timeframe09,bars097,beginbar09,buypianyiliang);

           }

         else

           {

            if(buymaxTotallots)

              {

               Print("YUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               comment("YUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               PlaySound("timeout.wav");

               return;

              }

            Print("^÷N	N
PÓNMOpNNUS Yt-N . . .");

            comment("^÷N	N
PÓNMOpNNUS Yt-N . . .");

            int keybuy=OrderSend(Symbol(),OP_BUY,keylots*3,Ask,keyslippage,0,0,NULL,0,0);

            if(keybuy>0)

               PlaySound("ok.wav");

            else

               PlaySound("timeout.wav");

           }

        }

      if(StrToInteger(sparam)==sellkey3)

        {

         if(shifttimeCurrent+holdingtime>=TimeCurrent())

           {

            buysellnowSL(false,keylotshalf*3,timeframe09,bars097,beginbar09,sellpianyiliang);

           }

         else

           {

            if(sellmaxTotallots)

              {

               Print("zzUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               comment("zzUS…ÇEA;`KbpeP–6R ÷‹Kb¨RNUSbŒtehQ@\ÂSpe");

               PlaySound("timeout.wav");

               return;

              }

            Print("^÷N	N
PÓNMOVSNUS Yt-N . . .");

            comment("^÷N	N
PÓNMOVSNUS Yt-N . . .");

            int keysell=OrderSend(Symbol(),OP_SELL,keylots*3,Bid,keyslippage,0,0,NULL,0,0);

            if(keysell>0)

               PlaySound("ok.wav");

            else

               PlaySound("timeout.wav");

           }

        }

      if(StrToInteger(sparam)==zuidaclose)

        {

         Print("s^÷N<hgؚ„vNUS Yt-N . . .");

         comment("s^÷N<hgؚ„vNUS Yt-N . . .");

         zuidakeyclose();

        }

      if(StrToInteger(sparam)==zuixiaoclose)

        {

         Print("s^÷N<hgNO„vNUS Yt-N . . .");

         comment("s^÷N<hgNO„vNUS Yt-N . . .");

         zuixiaokeyclose();

        }

      if(StrToInteger(sparam)==zuizaoclose)

        {

         Print("s^géeN„vNUS Yt-N . . .");

         comment("s^géeN„vNUS Yt-N . . .");

         zuizaokeyclose();

        }

      if(StrToInteger(sparam)==zuijinclose)

        {

         Print("s^gяN„vNUS Yt-N . . .");

         comment("s^gяN„vNUS Yt-N . . .");

         zuijinkeyclose();

        }

      if(StrToInteger(sparam)==8263)//Ctrl+Alt+\.•Øv7

        {

         buysellnowSL(true,keylotshalf*3,timeframe09,bars097,beginbar09,buypianyiliang);

        }

      if(StrToInteger(sparam)==8264)//Ctrl+Alt+\.•Øv8

        {

         buysellnowSL(true,keylotshalf*2,timeframe09,bars097,beginbar09,buypianyiliang);

        }

      if(StrToInteger(sparam)==8267)//Ctrl+Alt+\.•Øv4

        {

         buysellnowSL(false,keylotshalf*3,timeframe09,bars097,beginbar09,sellpianyiliang);

        }

      if(StrToInteger(sparam)==8268)//Ctrl+Alt+\.•Øv5

        {

         buysellnowSL(false,keylotshalf*2,timeframe09,bars097,beginbar09,sellpianyiliang);

        }

      if(StrToInteger(sparam)==8265)//Ctrl+Alt+\.•Øv9

        {

         buysellnowSL(true,keylotshalf,timeframe09,bars096,beginbar09,buypianyiliang9);

        }

      if(StrToInteger(sparam)==8269)//Ctrl+Alt+\.•Øv6

        {

         buysellnowSL(false,keylotshalf,timeframe09,bars096,beginbar09,sellpianyiliang6);

        }

      if(StrToInteger(sparam)==baobenSL)

        {

         Print("ybϑûy¨Rbk_c0RÝO,g¿~
N Yt-N . . .");

         comment("ybϑûy¨Rbk_c0RÝO,g¿~
N Yt-N . . .");

         double baobenbuySL=NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits);

         double baobensellSL=NormalizeDouble(HoldingOrdersellAvgPrice(),Digits);

         if(bkey)

            buybaobenture=true;

         if(skey)

            sellbaobenture=true;

         for(int  i=0; i<OrdersTotal(); i++)

           {

            if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

              {

               if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)

                 {

                  if(sellbaobenture)

                    { }

                  else

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),baobenbuySL,OrderTakeProfit(),0);

                    }

                 }

               if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)

                 {

                  if(buybaobenture)

                     break;

                  bool om=OrderModify(OrderTicket(),OrderOpenPrice(),baobensellSL,OrderTakeProfit(),0);

                 }

              }

           }

         PlaySound("ok.wav");

         buybaobenture=false;

         sellbaobenture=false;

        }

      if(StrToInteger(sparam)==baobenTP)

        {

         Print("ybϑûy¨RbkÈv0RÝO,g¿~
N Yt-N . . .");

         comment("ybϑûy¨RbkÈv0RÝO,g¿~
N Yt-N . . .");

         double baobenbuyTP=NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits);

         double baobensellTP=NormalizeDouble(HoldingOrdersellAvgPrice(),Digits);

         if(bkey)

            buybaobenture=true;

         if(skey)

            sellbaobenture=true;

         for(int  i=0; i<OrdersTotal(); i++)

           {

            if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

              {

               if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)

                 {

                  if(sellbaobenture)

                    { }

                  else

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),baobenbuyTP,0);

                    }

                 }

               if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)

                 {

                  if(buybaobenture)

                     break;

                  bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),baobensellTP,0);

                 }

              }

           }

         PlaySound("ok.wav");

         buybaobenture=false;

         sellbaobenture=false;

        }

      if(StrToInteger(sparam)==20)//T

        {

         if(shifttimeCurrent+1>=TimeCurrent() && shift==true)

           {

            Print("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcBuyLimitUS Yt-N . . .");

            comment("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcBuyLimitUS Yt-N . . .");

            Guadanbuylimit(Guadanlots1,GetiLowest(0,Guadanprice41,0)+Guadanbuylimitpianyiliang1*Point+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishubuylimit1*Point+press(),Guadangeshu1,Guadanjianju1,Guadansl1,Guadantp1,Guadanjuxianjia1);

            shift=false;

           }

         else

            shift=false;

        }

      if(StrToInteger(sparam)==31)//S

        {

         if(shifttimeCurrent+1>=TimeCurrent() && shift==true)

           {

            Print("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcSellLimitUS Yt-N . . .");

            comment("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcSellLimitUS Yt-N . . .");

            Guadanselllimit(Guadanlots1,GetiHighest(0,Guadanprice41,0)-Guadanselllimitpianyiliang1*Point-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishuselllimit1*Point+press(),Guadangeshu1,Guadanjianju1,Guadansl1,Guadantp1,Guadanjuxianjia1);

            shift=false;

           }

         else

            shift=false;

        }

      if(StrToInteger(sparam)==25)//

        {

         if(shifttimeCurrent+1>=TimeCurrent() && shift==true)

           {

            Print("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcBuyStopUS Yt-N . . .");

            comment("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcBuyStopUS Yt-N . . .");

            Guadanbuystop(Guadanlots1,GetiHighest(0,Guadanprice41,0)+MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu1*Point+press(),Guadangeshu1,Guadanjianju1,Guadansl1,Guadantp1,Guadanjuxianjia1);

            shift=false;

           }

         else

            shift=false;

        }

      if(StrToInteger(sparam)==38)//

        {

         if(shifttimeCurrent+1>=TimeCurrent() && shift==true)

           {

            Print("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcSellStopUS Yt-N . . .");

            comment("ë_wc¡‹—{gяK¿~„vgNOgؚ÷Nzfý€¡‹—{ybϑcSellStopUS Yt-N . . .");

            Guadansellstop(Guadanlots1,GetiLowest(0,Guadanprice41,0)-MarketInfo(Symbol(),MODE_SPREAD)*Guadandianchabeishu1*Point+press(),Guadangeshu1,Guadanjianju1,Guadansl1,Guadantp1,Guadanjuxianjia1);

            shift=false;

           }

         else

            shift=false;

        }

      if(StrToInteger(sparam)==34)//G s^cUS

        {



         if(shifttimeCurrent+1>=TimeCurrent() && shift==true)

           {

            Print("ybϑs^cUS Yt-N . . .");

            comment("ybϑs^cUS Yt-N . . .");

            pingguadan();

            shift=false;

            shifttimeCurrent=shifttimeCurrent-500;

           }

         else

            shift=false;

        }

      if(StrToInteger(sparam)==suoCang)

        {



         if(shifttimeCurrent+1>=TimeCurrent() && shift==true)

           {

            Print("N.••ÓN Yt-N . . .");

            comment("N.••ÓN Yt-N . . .");

            suocang();

            shift=false;

           }

         else

            shift=false;

        }

      if(StrToInteger(sparam)==fanxiangSuodan)

        {

         if(ctrltimeCurrent+1>=TimeCurrent() && ctrl==true)

           {

            Print("_ÍSTUS•ÓN Yt-N . . .");

            comment("_ÍSTUS•ÓN Yt-N . . .");

            fanxiangsuodan();

            ctrl=false;

           }

         else

            ctrl=false;

        }

      if(StrToInteger(sparam)==piliangSLTP)

        {

         if(tabtimeCurrent+1>=TimeCurrent() && tab==true)

           {

            Gradually=false;

            Print("؞¤‹ybϑ¾‹nbkÈvbk_c5000¹p ØSøvÖSˆm ÅN”^%`O(u  Yt-N . . .");

            comment("؞¤‹ybϑ¾‹nbkÈvbk_c5000¹p ØSøvÖSˆm ÅN”^%`O(u  Yt-N . . .");

            StopLoss=5000;

            TargetProfit=5000;

            piliangsltp();

            tab=false;

            StopLoss=0;

            TargetProfit=0;

            FixedStopLoss=0.0;

            FixedTargetProfit=0.0;

            return;

           }

         else

            tab=false;

        }

      if(StrToInteger(sparam)==yijianPingcang)

        {

         Print("N.•s^ÓN Yt-N . . .");

         comment("N.•s^ÓN Yt-N . . .");

         xunhuanquanpingcang();

         ctrl=false;

        }

      if(StrToInteger(sparam)==yijianPingbuydan)

        {

         Print("N.•s^buyUS Yt-N . . .");

         comment("N.•s^buyUS Yt-N . . .");

         yijianpingbuydan();

         ctrl=false;

        }

      if(StrToInteger(sparam)==yijianPingselldan)

        {

         Print("N.•s^sellUS Yt-N . . .");

         comment("N.•s^sellUS Yt-N . . .");

         yijianpingselldan();

         ctrl=false;

        }

     }

  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnTick()//ttt

  {

   if(dingshipingcang)//S_MR”NRŸ”K¿~6e¿~öes^ÓN

     {

      int m=TimeMinute(TimeGMT());

      if(m==4 || m==9 || m==14 || m==19 || m==24 || m==29 || m==34|| m==39|| m==44 || m==49|| m==54|| m==59)

        {

         if(TimeSeconds(TimeGMT())>=55)

           {

            Print("š[öes^ÓNæ‰ÑSöeô• ",TimeCurrent());

            xunhuanquanpingcang();

            dingshipingcang=false;

            Print("”NRŸ”K¿~6e¿~öes^ÓN Œ[b");

            comment("”NRŸ”K¿~6e¿~öes^ÓN Œ[b");

           }

        }

     }

   if(dingshipingcang15)//S_MRAS”NRŸ”K¿~6e¿~öes^ÓN

     {

      int m=TimeMinute(TimeGMT());

      if(m==14 || m==29 || m==44 || m==59)

        {

         if(TimeSeconds(TimeGMT())>=55)

           {

            Print("š[öes^ÓNæ‰ÑSöeô• ",TimeCurrent());

            xunhuanquanpingcang();

            dingshipingcang15=false;

            Print("AS”NRŸ”K¿~6e¿~öes^ÓN Œ[b");

            comment("AS”NRŸ”K¿~6e¿~öes^ÓN Œ[b");

           }

        }

     }

//Print(TimeGMTOffset());

//Print("TICK ",TimeGMT());

// Print(TimeCurrent());

//  Print(TimeMinute(TimeGMT()));

//  Print(TimeSeconds(TimeGMT()));

   if(huaxianguadan)

      Huaxianguadan();//R¿~cUS

   if(huaxiankaicang)

      Huaxiankaicang();//æ‰ÊS¿~_ÓN

   if(huaxianSwitch)

      HuaxianSwitch();

/////////////////////////////////////////////////////////////////////// eR4Y®v_ËY

   if(SLbuylineQpingcangT1)//* buyUS…Ç*j¿~NUSNUSs^ÓN ÅNbkÈv(u

     {

      if(SLsellQpengcangline<=Bid)

        {

         Sleep(SLQlinepingcangSleep);

         yijianpingcangMagic(1688);

         SLbuylineQpingcangT=false;

         SLbuylineQpingcang=false;

         SLsellQpengcangline1=Bid+1000*Point;

         ObjectMove(0,"SLsellQpengcangline1",0,Time[0],SLsellQpengcangline1);

        }

     }

   if(SLselllineQpingcangT1)//* sellUS…Ç*j¿~NUSNUSs^ÓN ÅNbkÈv(u

     {

      if(SLbuyQpengcangline>=Bid)

        {

         Sleep(SLQlinepingcangSleep);

         yijianpingcangMagic(1688);

         SLselllineQpingcangT=false;

         SLselllineQpingcang=false;

         SLbuyQpengcangline1=Ask-1000*Point;

         ObjectMove(0,"SLbuyQpengcangline1",0,Time[0],SLbuyQpengcangline1);

        }

     }

   if(SLbuylineQpingcangT)//buyUS…Ç*j¿~NUSNUSs^ÓN ÅNbkÈv(u

     {

      //    Sleep(linepingcangRTime);

      if(SLsellQpengcangline<=Bid)

        {

         if(TimeSeconds(TimeCurrent())/timeseconds==MathRound(TimeSeconds(TimeCurrent())/timeseconds))

           {

            if(timesecondstrue!=TimeSeconds(TimeCurrent()))

              {

               timesecondstrue=TimeSeconds(TimeCurrent());

               Print("ûN¡RgbLˆ-N S_MRöeô•„vÒype ",TimeSeconds(TimeCurrent()));

               zuijinkeyclose();

              }

           }

         if(CGetbuyLots()==0.0)

           {

            SLsellQpengcangline=Bid+1000*Point;

            ObjectMove(0,"SLsellQpengcangline",0,Time[0],SLsellQpengcangline);

           }

        }

     }







   if(SLselllineQpingcangT)//sellUS…Ç*j¿~NUSNUSs^ÓN ÅNbkÈv(u

     {

      //   Sleep(linepingcangRTime);

      if(SLbuyQpengcangline>=Bid)

        {

         if(TimeSeconds(TimeCurrent())/timeseconds==MathRound(TimeSeconds(TimeCurrent())/timeseconds))

           {

            if(timesecondstrue!=TimeSeconds(TimeCurrent()))

              {

               timesecondstrue=TimeSeconds(TimeCurrent());

               Print("ûN¡RgbLˆ-N S_MRöeô•„vÒype ",TimeSeconds(TimeCurrent()));

               zuijinkeyclose();

              }

           }

         if(CGetsellLots()==0.0)

           {

            SLbuyQpengcangline=Ask-1000*Point;

            ObjectMove(0,"SLbuyQpengcangline",0,Time[0],SLbuyQpengcangline);

           }

        }

     }



   if(SLbuylinepingcang)//buyUSŠÇ*j¿~NUSNUSbk_cs^ÓN

     {

      if(SL1mbuyLineprice>=Ask || SL5mbuyLineprice>=Ask || SL15mbuyLineprice>=Ask)//æ‰ÊSbk_c¿~Os^‰cèRÓNMO

        {

         if(SL1mbuyLineprice>=Ask)

           {

            if(SLlinepingcangjishu>SLlinepingcangjishu1)

              {

               Sleep(SLlinepingcangtime);

               zuijinkeyclose();

               SLlinepingcangjishu1++;

              }

            else

              {

               SLlinepingcangjishu1=0;

               SL1mbuyLine=false;

               SL1mbuyLineprice=Ask-1000*Point;

               if(ObjectFind("SL1mbuyLine")==0)

                  ObjectDelete("SL1mbuyLine");

              }

           }

         else

           {

            if(SL5mbuyLineprice>=Ask)

              {

               if(SLlinepingcangjishu>SLlinepingcangjishu1)

                 {

                  Sleep(SLlinepingcangtime);

                  zuijinkeyclose();

                  SLlinepingcangjishu1++;

                 }

               else

                 {

                  SLlinepingcangjishu1=0;

                  SL5mbuyLine=false;

                  SL5mbuyLineprice=Ask-1000*Point;

                  if(ObjectFind("SL5mbuyLine")==0)

                     ObjectDelete("SL5mbuyLine");

                 }

              }

            else

              {

               Sleep(SLlinepingcangtime);

               zuijinkeyclose();

              }

           }

        }

     }

   if(SLselllinepingcang)//sellUSŠÇ*j¿~NUSNUSbk_cs^ÓN

     {

      if(SL1msellLineprice<=Bid || SL5msellLineprice<=Bid || SL15msellLineprice<=Bid)

        {

         if(SL1msellLineprice<=Bid)

           {

            if(SLlinepingcangjishu>SLlinepingcangjishu1)

              {

               Sleep(SLlinepingcangtime);

               zuijinkeyclose();

               SLlinepingcangjishu1++;

              }

            else

              {

               SLlinepingcangjishu1=0;

               SL1msellLine=false;

               SL1msellLineprice=Bid+1000*Point;

               if(ObjectFind("SL1msellLine")==0)

                  ObjectDelete("SL1msellLine");

              }

           }

         else

           {

            if(SL5msellLineprice<=Bid)

              {

               if(SLlinepingcangjishu>SLlinepingcangjishu1)

                 {

                  Sleep(SLlinepingcangtime);

                  zuijinkeyclose();

                  SLlinepingcangjishu1++;

                 }

               else

                 {

                  SLlinepingcangjishu1=0;

                  SL5msellLine=false;

                  SL5msellLineprice=Bid+1000*Point;

                  if(ObjectFind("SL5msellLine")==0)

                     ObjectDelete("SL5msellLine");

                 }

              }

            else

              {

               Sleep(SLlinepingcangtime);

               zuijinkeyclose();

              }

           }

        }

     }



////////////////////////////////////////////////////////////////////// eR4Y®vÓ~_g

   if(linebuyfansuo)//æ‰ÊS*j¿~4Nöe•ÓN

     {

      if(buyline<buylineOnTimer && buyline>Bid)//*j¿~(WS_MR÷NKNN

        {

         Print("buyline=",buyline,"buylineOnTimer=",buylineOnTimer,"*j¿~(WS_MR÷NKNN");

         suocang();

         linebuyfansuo=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }







      if(buyline>buylineOnTimer && buyline<Bid)//*j¿~(WS_MR÷NKN
N

        {

         Print("buyline=",buyline,"buylineOnTimer=",buylineOnTimer,"*j¿~(WS_MR÷NKN
N");

         suocang();

         linebuyfansuo=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }

     }







   if(linesellfansuo)//æ‰ÊS*j¿~4Nöe•ÓN

     {

      if(sellline>selllineOnTimer && sellline<Bid)//*j¿~(WS_MR÷NKN
N

        {

         suocang();

         linesellfansuo=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }







      if(sellline<selllineOnTimer && sellline>Bid)//*j¿~(WS_MR÷NKNN

        {

         suocang();

         linesellfansuo=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }

     }







   if(linebuypingcangR)////buyUS…Ç*j¿~NUSNUSs^ÓN ÅNbkÈv(u

     {

      //    Sleep(linepingcangRTime);

      if(sellline<=Bid)

        {

         if(TimeSeconds(TimeCurrent())/timeseconds==MathRound(TimeSeconds(TimeCurrent())/timeseconds))

           {

            if(timesecondstrue!=TimeSeconds(TimeCurrent()))

              {

               timesecondstrue=TimeSeconds(TimeCurrent());

               Print("ûN¡RgbLˆ-N S_MRöeô•„vÒype ",TimeSeconds(TimeCurrent()));

               zuijinkeyclose();

              }

           }

         if(CGetbuyLots()==0.0)

           {

            linebuypingcangR=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

            Print("…Ç*j¿~NUSNUSs^ÓN sQí•");

           }

        }

     }







   if(linesellpingcangR)//sellUS…Ç*j¿~NUSNUSs^ÓN ÅNbkÈv(u

     {

      //   Sleep(linepingcangRTime);

      if(buyline>=Bid)

        {

         if(TimeSeconds(TimeCurrent())/timeseconds==MathRound(TimeSeconds(TimeCurrent())/timeseconds))

           {

            if(timesecondstrue!=TimeSeconds(TimeCurrent()))

              {

               timesecondstrue=TimeSeconds(TimeCurrent());

               Print("ûN¡RgbLˆ-N S_MRöeô•„vÒype ",TimeSeconds(TimeCurrent()));

               zuijinkeyclose();

              }

           }

         if(CGetsellLots()==0.0)

           {

            linesellpingcangR=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

            Print("…Ç*j¿~NUSNUSs^ÓN sQí•");

           }

        }

     }







   if(linebuypingcang)//æ‰ÊS*j¿~hQs^ÓN

     {

      if(buyline<buylineOnTimer && buyline>=Bid)//*j¿~(WS_MR÷NKNN

        {

         if(linebuypingcangctrlR)

           {

            PiliangTP(true,NormalizeDouble(buyline+linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangTP(false,NormalizeDouble(buyline-linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(true,NormalizeDouble(buyline-linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(false,NormalizeDouble(buyline+linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            linebuypingcang=false;

            linebuypingcangctrlR=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

         else

           {

            xunhuanquanpingcang();

            linebuypingcang=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

        }







      if(buyline>buylineOnTimer && buyline<=Bid)//*j¿~(WS_MR÷NKN
N

        {

         if(linebuypingcangctrlR)

           {

            PiliangTP(true,NormalizeDouble(buyline+linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangTP(false,NormalizeDouble(buyline-linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(true,NormalizeDouble(buyline-linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(false,NormalizeDouble(buyline+linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            linebuypingcang=false;

            linebuypingcangctrlR=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

         else

           {

            xunhuanquanpingcang();

            linebuypingcang=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

        }

     }







   if(linesellpingcang)//æ‰ÊS*j¿~hQs^ÓN

     {

      if(sellline>selllineOnTimer && sellline<=Bid)//*j¿~(WS_MR÷NKN
N

        {

         if(linesellpingcangctrlR)

           {

            PiliangTP(true,NormalizeDouble(sellline+linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangTP(false,NormalizeDouble(sellline-linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(true,NormalizeDouble(sellline-linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(false,NormalizeDouble(sellline+linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            linesellpingcang=false;

            linesellpingcangctrlR=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

         else

           {

            xunhuanquanpingcang();

            linesellpingcang=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

        }







      if(sellline<selllineOnTimer && sellline>=Bid)//*j¿~(WS_MR÷NKNN

        {

         if(linesellpingcangctrlR)

           {

            PiliangTP(true,NormalizeDouble(sellline+linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangTP(false,NormalizeDouble(sellline-linebuypingcangctrlRpianyi*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(true,NormalizeDouble(sellline-linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            PiliangSL(false,NormalizeDouble(sellline+linebuypingcangctrlRpianyi*2*Point,Digits),0,0,0,dingdanshu);

            linesellpingcang=false;

            linesellpingcangctrlR=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

         else

           {

            xunhuanquanpingcang();

            linesellpingcang=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

        }

     }







   if(linebuykaicang && buyline>=Bid)//æ‰ÊS*j¿~_ÓN buy

     {

      if(linekaicangshiftR)

        {

         if(buyline>=Bid)

           {

            if(TimeSeconds(TimeCurrent())/timeseconds1==MathRound(TimeSeconds(TimeCurrent())/timeseconds1))

              {

               if(timesecondstrue!=TimeSeconds(TimeCurrent()))

                 {

                  timesecondstrue=TimeSeconds(TimeCurrent());

                  Print("ûN¡RgbLˆ-N S_MRöeô•„vÒype ",TimeSeconds(TimeCurrent()));

                  buysellnowSL(true,keylots,0,linekaicangshiftRbars,0,linekaicangshiftRpianyi);

                  if(falsetimeCurrent+1>TimeCurrent())

                    {

                     Print(TimeCurrent()," ꁨR_ÓNúQ• iRYO!kpe",huaxiankaicanggeshuR1);

                    }

                  else

                    {

                     huaxiankaicanggeshuR1--;

                     Print(TimeCurrent()," ꁨR_ÓNbŸR iRYO!kpe",huaxiankaicanggeshuR1);

                    }

                  if(huaxiankaicanggeshuR1==0)

                    {

                     linebuykaicang=false;

                     linekaicangshiftR=false;

                     linelock=false;

                     huaxiankaicanggeshuR1=huaxiankaicanggeshuR;

                     timeseconds1=timeseconds1P;

                     if(ObjectFind(0,"Buy Line")==0)

                        ObjectDelete(0,"Buy Line");

                     if(ObjectFind(0,"Sell Line")==0)

                        ObjectDelete(0,"Sell Line");

                    }

                 }

              }

           }

        }

      else

        {

         if(linekaicangT && buyline>=Bid)

           {

            RefreshRates();

            Sleep(huaxiankaicangtimeT);

            Print(TimeCurrent(),"  ",huaxiankaicanggeshuT1);

            // Print("^÷NpNNUS Yt-N . . .");comment("^÷NpNNUS Yt-N . . .");

            if(ObjectFind(0,"SL Line")==0)

              {

               int  keybuy10=OrderSend(Symbol(),OP_BUY,huaxiankaicanglotsT,Ask,keyslippage,slline,0,NULL,MathRand(),0);

               if(keybuy10>0)

                 {

                  PlaySound("ok.wav");

                  huaxiankaicanggeshuT1--;

                 }

               else

                 {

                  PlaySound("timeout.wav");

                  Print("GetLastError=",GetLastError());

                 }

              }

            else

              {

               int  keybuy10=OrderSend(Symbol(),OP_BUY,huaxiankaicanglotsT,Ask,keyslippage,0,0,NULL,MathRand(),0);

               if(keybuy10>0)

                 {

                  PlaySound("ok.wav");

                  huaxiankaicanggeshuT1--;

                 }

               else

                 {

                  PlaySound("timeout.wav");

                  Print("GetLastError=",GetLastError());

                 }

              }

            if(huaxiankaicanggeshuT1==0)

              {

               huaxiankaicanggeshuT1=huaxiankaicanggeshuT;

               linebuykaicang=false;

               linelock=false;

               linekaicangT=false;

               if(ObjectFind(0,"Buy Line")==0)

                  ObjectDelete(0,"Buy Line");

               if(ObjectFind(0,"Sell Line")==0)

                  ObjectDelete(0,"Sell Line");

               if(ObjectFind(0,"SL Line")==0)

                  ObjectDelete(0,"SL Line");

              }

           }

         else

           {

            for(int i=huaxiankaicanggeshu1; i>0; i--)

              {

               RefreshRates();

               Sleep(huaxiankaicangtime);

               //Print(TimeCurrent(),"  ",i);

               //Print("^÷NpNNUS Yt-N . . .");comment("^÷NpNNUS Yt-N . . .");

               int  keybuy10=OrderSend(Symbol(),OP_BUY,keylots,Ask,keyslippage,0,0,NULL,MathRand(),0);

               if(keybuy10>0)

                  PlaySound("ok.wav");

               else

                 {

                  PlaySound("timeout.wav");

                  i++;

                  Print("GetLastError=",GetLastError());

                 }

              }

            huaxiankaicanggeshu1=huaxiankaicanggeshu;

            linebuykaicang=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

        }

     }







   if(linesellkaicang && sellline<=Bid)//æ‰ÊS*j¿~_ÓN sell

     {

      if(linekaicangshiftR)

        {

         if(sellline<=Bid)

           {



            if(TimeSeconds(TimeCurrent())/timeseconds1==MathRound(TimeSeconds(TimeCurrent())/timeseconds1))

              {

               if(timesecondstrue!=TimeSeconds(TimeCurrent()))

                 {

                  timesecondstrue=TimeSeconds(TimeCurrent());

                  Print("ûN¡RgbLˆ-N S_MRöeô•„vÒype ",TimeSeconds(TimeCurrent()));

                  buysellnowSL(false,keylots,0,linekaicangshiftRbars,0,linekaicangshiftRpianyi);

                  if(falsetimeCurrent+1>TimeCurrent())

                    {

                     Print(TimeCurrent()," ꁨR_ÓNúQ• iRYO!kpe",huaxiankaicanggeshuR1);

                    }

                  else

                    {

                     huaxiankaicanggeshuR1--;

                     Print(TimeCurrent()," ꁨR_ÓNbŸR iRYO!kpe",huaxiankaicanggeshuR1);

                    }

                  if(huaxiankaicanggeshuR1==0)

                    {

                     linekaicangshiftR=false;

                     linesellkaicang=false;

                     linelock=false;

                     huaxiankaicanggeshuR1=huaxiankaicanggeshuR;

                     timeseconds1=timeseconds1P;

                     if(ObjectFind(0,"Buy Line")==0)

                        ObjectDelete(0,"Buy Line");

                     if(ObjectFind(0,"Sell Line")==0)

                        ObjectDelete(0,"Sell Line");

                    }

                 }

              }

            //  Sleep(huaxiankaicangtimeshiftR);

           }

        }







      else

        {

         if(linekaicangT && sellline<=Bid)

           {

            RefreshRates();

            Sleep(huaxiankaicangtimeT);

            // Print(TimeCurrent(),"  ",huaxiankaicanggeshuT1);

            // Print("^÷NVSNUS Yt-N . . .");comment("^÷NVSNUS Yt-N . . .");

            if(ObjectFind(0,"SL Line")==0)

              {

               int  keysell10=OrderSend(Symbol(),OP_SELL,huaxiankaicanglotsT,Bid,keyslippage,slline,0,NULL,MathRand(),0);

               if(keysell10>0)

                 {

                  PlaySound("ok.wav");

                  huaxiankaicanggeshuT1--;

                 }

               else

                 {

                  PlaySound("timeout.wav");

                  Print("GetLastError=",GetLastError());

                 }

              }

            else

              {

               int  keysell10=OrderSend(Symbol(),OP_SELL,huaxiankaicanglotsT,Bid,keyslippage,0,0,NULL,MathRand(),0);

               if(keysell10>0)

                 {

                  PlaySound("ok.wav");

                  huaxiankaicanggeshuT1--;

                 }

               else

                 {

                  PlaySound("timeout.wav");

                  Print("GetLastError=",GetLastError());

                 }

              }

            if(huaxiankaicanggeshuT1==0)

              {

               huaxiankaicanggeshuT1=huaxiankaicanggeshuT;

               linesellkaicang=false;

               linelock=false;

               linekaicangT=false;

               if(ObjectFind(0,"Buy Line")==0)

                  ObjectDelete(0,"Buy Line");

               if(ObjectFind(0,"Sell Line")==0)

                  ObjectDelete(0,"Sell Line");

               if(ObjectFind(0,"SL Line")==0)

                  ObjectDelete(0,"SL Line");

              }

           }

         else

           {

            for(int i=huaxiankaicanggeshu; i>0; i--)

              {

               RefreshRates();

               Sleep(huaxiankaicangtime);

               //Print(TimeCurrent(),"  ",i);

               //Print("^÷NVSNUS Yt-N . . .");comment("^÷NVSNUS Yt-N . . .");

               int keysell10=OrderSend(Symbol(),OP_SELL,keylots,Bid,keyslippage,0,0,NULL,MathRand(),0);

               if(keysell10>0)

                  PlaySound("ok.wav");

               else

                 {

                  PlaySound("timeout.wav");

                  i++;

                  Print("GetLastError=",GetLastError());

                 }

              }

            linesellkaicang=false;

            linelock=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }



        }

     }

   if(EAswitch==false)

      return;

   if(OrdersTotal()==0  ||  Lots()==0.0)

      return;

   if(linebuyzidongjiacang)//”NRŸ”ꁨRýBuyUS

     {

      int T=TimeMinute(TimeCurrent());

      if(linefirsttime)//,{N!k_/TöegbLˆ

        {

         if(Open[1]-Close[1]<0)

           {

            double p1=Close[1]-20*Point;

            double p2=Bid-20*Point;

            if(p2<p1)

              {

               buyline=p2;

               if(ObjectFind("Buy Line")==0)

                  ObjectMove(0,"Buy Line",0,Time[1],buyline);

              }

            else

              {

               buyline=p1;

               if(ObjectFind("Buy Line")==0)

                  ObjectMove(0,"Buy Line",0,Time[1],buyline);

              }

            linefirsttime=false;

           }

        }







      if(T==1 || T==5 || T==10 || T==15 || T==20 || T==25 || T==30 || T==35 || T==40 || T==45 || T==50 || T==55)//š[öegbLˆ

        {

         if(linetime<T)

            lineTime=false;

         if(linetime==55 && T==1)

            lineTime=false;

         if(Open[1]-Close[1]<0 && lineTime==false)

           {

            buyline=Close[1]-linebuyzidongjiacangpianyi*Point;

            if(ObjectFind("Buy Line")==0)

              {

               bool T1=ObjectMove(0,"Buy Line",0,Time[1],buyline);

               if(T1)

                 {

                  lineTime=true;

                  linetime=T;

                 }

              }

           }

        }







      if(huaxianzidongjiacanggeshu1==0)

        {

         huaxianzidongjiacanggeshutime1--;

         if(huaxianzidongjiacanggeshutime1>0)

           {

            if(ObjectFind("Buy Line")==0)

               ObjectMove(0,"Buy Line",0,Time[1],buyline-linezidongjiacangyidong*Point);

            buyline=buyline-linezidongjiacangyidong*Point;

            huaxianzidongjiacanggeshu1=huaxianzidongjiacanggeshu;

           }

         else

           {

            linebuyzidongjiacang=false;

            linelock=false;

            huaxianzidongjiacanggeshu1=huaxianzidongjiacanggeshu;

            huaxianzidongjiacanggeshutime1=huaxianzidongjiacanggeshutime;

            lineTime=false;

            linetime=0;

            linefirsttime=true;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

        }







      else

        {

         if(buyline>=Bid)

           {

            RefreshRates();

            Sleep(huaxiankaicangtime);

            buysellnowSL(true,huaxianzidongjiacanglots,5,7,0,50);

            huaxianzidongjiacanggeshu1--;

           }

        }

     }







   if(linesellzidongjiacang)//”NRŸ”ꁨRýSellUS

     {

      int T=TimeMinute(TimeCurrent());







      if(linefirsttime)//,{N!k_/TöegbLˆ

        {

         if(Open[1]-Close[1]>0)

           {

            double p1=Close[1]+20*Point;

            double p2=Bid+20*Point;

            if(p2>p1)

              {

               sellline=p2;

               if(ObjectFind("Sell Line")==0)

                  ObjectMove(0,"Sell Line",0,Time[1],sellline);

              }

            else

              {

               sellline=p1;

               if(ObjectFind("Sell Line")==0)

                  ObjectMove(0,"Sell Line",0,Time[1],sellline);

              }

            linefirsttime=false;

           }

        }







      if(T==1 || T==5 || T==10 || T==15 || T==20 || T==25 || T==30 || T==35 || T==40 || T==45 || T==50 || T==55)//š[öegbLˆ

        {

         if(linetime<T)

            lineTime=false;

         if(linetime==55 && T==1)

            lineTime=false;

         if(Open[1]-Close[1]>0 && lineTime==false)

           {

            sellline=Close[1]+linesellzidongjiacangpianyi*Point;

            if(ObjectFind("Sell Line")==0)

              {

               bool T1=ObjectMove(0,"Sell Line",0,Time[1],sellline);

               if(T1)

                 {

                  lineTime=true;

                  linetime=T;

                 }

              }

           }

        }







      if(huaxianzidongjiacanggeshu1==0)

        {

         huaxianzidongjiacanggeshutime1--;

         if(huaxianzidongjiacanggeshutime1>0)

           {

            if(ObjectFind("Sell Line")==0)

               ObjectMove(0,"Sell Line",0,Time[1],sellline+linezidongjiacangyidong*Point);

            sellline=sellline+linezidongjiacangyidong*Point;

            huaxianzidongjiacanggeshu1=huaxianzidongjiacanggeshu;

           }

         else

           {

            linesellzidongjiacang=false;

            linelock=false;

            huaxianzidongjiacanggeshu1=huaxianzidongjiacanggeshu;

            huaxianzidongjiacanggeshutime1=huaxianzidongjiacanggeshutime;

            lineTime=false;

            linetime=0;

            linefirsttime=true;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

        }







      else

        {

         if(sellline<=Bid)

           {

            RefreshRates();

            Sleep(huaxiankaicangtime);

            buysellnowSL(false,huaxianzidongjiacanglots,5,7,0,50);

            huaxianzidongjiacanggeshu1--;

           }

        }

     }







   if(tickclose)//Tickpe<PØSSgRÈp ꁨR_ËYs^ÓN

     {

      int jishu=tickjishu;

      double abs=0;







      switch(tickjishu)

        {

         case 4:

           {

            tick4=Bid;

            tickjishu--;

           }

         break;

         case 3:

           {

            tick3=Bid;

            tickjishu--;

           }

         break;

         case 2:

           {

            tick2=Bid;

            tickjishu--;

           }

         break;

         case 1:

           {

            tick1=Bid;

            tickjishu--;

           }

         break;

         case 0:

           {

            tick0=Bid;

            tickjishu=4;

           }

         break;

        }







      switch(jishu)

        {

         case 4:

           {

            abs=(NormalizeDouble(tick4-tick3,Digits)/Point);

           }

         break;

         case 3:

           {

            abs=(NormalizeDouble(tick3-tick2,Digits)/Point);

           }

         break;

         case 2:

           {

            abs=(NormalizeDouble(tick2-tick1,Digits)/Point);

           }

         break;

         case 1:

           {

            abs=(NormalizeDouble(tick1-tick0,Digits)/Point);

           }

         break;

         case 0:

           {

            abs=(NormalizeDouble(tick0-tick4,Digits)/Point);

           }

         break;

        }







      if(tickbuyclose)

        {

         if(tickShift)

            Print("TickØSS<P= ",abs," „˜¾‹<P",glotickclosenum,"  tickjishu=",jishu," tick4=",tick4," tick3=",tick3," tick2=",tick2," tick1=",tick1," tick0=",tick0);

         if(abs>glotickclosenum && MathAbs(abs)<500)

           {

            xunhuanquanpingcang();

            tickclose=false;

            Print("Tickpe<PØSSgRÈp pe<P'YŽN„˜¾‹<P",glotickclosenum,"ꁨR_ËYs^ÓN");

            comment1("Tickpe<PØSSgRÈp'YŽN„˜¾‹<PꁨR_ËYs^ÓN");

           }

        }







      else

        {

         if(tickShift)

            Print("TickØSS<P= ",abs," „˜¾‹<P",-glotickclosenum,"  tickjishu=",jishu," tick4=",tick4," tick3=",tick3," tick2=",tick2," tick1=",tick1," tick0=",tick0);

         if(abs<-glotickclosenum && MathAbs(abs)<500)

           {

            xunhuanquanpingcang();

            tickclose=false;

            Print("Tickpe<PØSSgRÈp pe<P'YŽN„˜¾‹<P",-glotickclosenum,"ꁨR_ËYs^ÓN");

            comment1("Tickpe<PØSSgRÈp'YŽN„˜¾‹<PꁨR_ËYs^ÓN");

           }

        }

     }

   if(Tickmode  && fansuoYes==false)

      closecode();//Reks^ÓN





  }





//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnTimer()//tttt

  {

//int  m = TimeSeconds(TimeCurrent());

// Print(pingcangdingdanshu);

//

//Print(AccountProfit());

// Print(SL5QTPtimeCurrent+10);

//double mb=NormalizeDouble(iCustom(NULL,0,"Custom/MBFX Timing",7,0.0,0,0),4);

//double bs=NormalizeDouble(iCustom(NULL,0,"Custom/bstrend-indicator",12,0,0),5);

//Print(mb);

//Print(bs);

// Print(TimeGMT());

//Print(iLow(NULL,PERIOD_M5,1));

// Print(iLow(NULL,PERIOD_M15,1));

//   Print(iLowest(NULL,PERIOD_M1,MODE_LOW,7,0));

//  Print("1=",SL1mbuyLineprice," ","5=",SL5mbuyLineprice," ","15=",SL15mbuyLineprice);



   if(CGetbuyLots()>=GlobalVariableGet("glomaxTotallots"))

      buymaxTotallots=true;

   else

      buymaxTotallots=false;//P–6REAg'YNUSϑ

   if(CGetsellLots()>=GlobalVariableGet("glomaxTotallots"))

      sellmaxTotallots=true;

   else

      sellmaxTotallots=false;

   if(ObjectFind(0,"Buy Line")==0)

     {

      buyline=NormalizeDouble(ObjectGet("Buy Line",1),Digits);   //š[öeôf°e*j¿~„v÷N<h

      buylineOnTimer=Bid;

     }

   if(ObjectFind(0,"Sell Line")==0)

     {

      sellline=NormalizeDouble(ObjectGet("Sell Line",1),Digits);   //š[öeôf°e*j¿~„v÷N<h

      selllineOnTimer=Bid;

     }

   if(ObjectFind(0,"SL1mbuyLine")==0)

     {

      SL1mbuyLineprice=NormalizeDouble(ObjectGet("SL1mbuyLine",1),Digits);

     }

   if(ObjectFind(0,"SL5mbuyLine")==0)

     {

      SL5mbuyLineprice=NormalizeDouble(ObjectGet("SL5mbuyLine",1),Digits);

     }

   if(ObjectFind(0,"SL15mbuyLine")==0)

     {

      SL15mbuyLineprice=NormalizeDouble(ObjectGet("SL15mbuyLine",1),Digits);

     }

   if(ObjectFind(0,"SL1msellLine")==0)

     {

      SL1msellLineprice=NormalizeDouble(ObjectGet("SL1msellLine",1),Digits);

     }

   if(ObjectFind(0,"SL5msellLine")==0)

     {

      SL5msellLineprice=NormalizeDouble(ObjectGet("SL5msellLine",1),Digits);

     }

   if(ObjectFind(0,"SL15msellLine")==0)

     {

      SL15msellLineprice=NormalizeDouble(ObjectGet("SL15msellLine",1),Digits);

     }

   if(huaxianTimeSwitch)

      HuaxianSwitch();//(Wš[öehV-NO(uR¿~s^ÓNbÍS• bulls^ÓN



   if(SL5QTPtimeCurrenttrue)//

     {

      if(SL5QTPtimeCurrent+SL5QTPtime<TimeCurrent())

        {

         SLQlotsT=SLQlots;

         if(SL5QTPtimeCurrent+SL5QTPtime1<TimeCurrent())

           {

            yijianpingcangMagic(1688);

            Print("eR4Y®vI{…_öeô•…Ç",SL5QTPtime1,"Òyôv¥cs^ÓN ",SL5QTPtimeCurrent);

            comment(StringFormat("eR4Y®vI{…_öeô•…Ç%GÒyôv¥cs^ÓN",SL5QTPtime1));

            SL5QTPtimeCurrenttrue=false;

            SLbuylineQpingcangT=false;

            SLbuylineQpingcang=false;

            SLselllineQpingcangT=false;

            SLselllineQpingcang=false;

            if(ObjectFind(0,"SLsellQpengcangline1")==0)

               ObjectDelete(0,"SLsellQpengcangline1");

            if(ObjectFind(0,"SLbuyQpengcangline1")==0)

               ObjectDelete(0,"SLbuyQpengcangline1");

           }

         else

           {

            if(AccountProfit()>0.0)

              {

               yijianpingcangMagic(1688);

               Print("eR4Y®vI{…_öeô•…Ç",SL5QTPtime,"ÒyÝO,gs^ÓN ",SL5QTPtimeCurrent);

               comment(StringFormat("eR4Y®vI{…_öeô•…Ç%GÒyÝO,gs^ÓN",SL5QTPtime));

               SL5QTPtimeCurrenttrue=false;

               SLbuylineQpingcangT=false;

               SLbuylineQpingcang=false;

               SLselllineQpingcangT=false;

               SLselllineQpingcang=false;

               if(ObjectFind(0,"SLsellQpengcangline1")==0)

                  ObjectDelete(0,"SLsellQpengcangline1");

               if(ObjectFind(0,"SLbuyQpengcangline1")==0)

                  ObjectDelete(0,"SLbuyQpengcangline1");

              }

           }

        }

     }

//-----

   if(imbfxT)//

     {

      double mbfx=NormalizeDouble(iCustom(NULL,0,"Custom/MBFX Timing",7,0.0,0,0),4);

      if(mbfx==0.0)

        {

         comment("MBFXch¡l	g~b0R àeÕl/T(u ÷‹>e0RIndicators/Custom/MBFX Timing.ex4 ");

         imbfxT=false;

         return;

        }

      if(GetHoldingbuyOrdersCount()>0 && GetHoldingsellOrdersCount()==0.0)//

        {

         if(mbfx>imbfxTmax)

           {

            xunhuanquanpingcang();

            imbfxT=false;

            Print("MBFXch 'YŽN",imbfxTmax,"ꁨRs^ÓN ",mbfx);

           }

        }

      else

        {

         if(GetHoldingbuyOrdersCount()==0.0 && GetHoldingsellOrdersCount()>0)//

           {

            if(mbfx<imbfxTmin)

              {

               xunhuanquanpingcang();

               imbfxT=false;

               Print("MBFXch \ŽN",imbfxTmin,"ꁨRs^ÓN ",mbfx);

              }

           }

         else

           {

            comment("¡l¢‹USbYzzUSý	g àeÕl/T¨Rchs^ÓN");

            Print("¡l¢‹USbYzzUSý	g àeÕl/T¨Rchs^ÓN");

           }

        }

     }

//----

//-----

   if(iBSTrend)//

     {

      double bstrend=NormalizeDouble(iCustom(NULL,0,"Custom/bstrend-indicator",12,0,0),5);

      //Print(bstrend);

      if(bstrend==0.0)

        {

         comment("BSTrendch¡l	g~b0R àeÕl/T(u ÷‹>e0RIndicators/Custom/bstrend-indicator.ex4 ");

         Print("BSTrendch¡l	g~b0R àeÕl/T(u bR}YS_MR„vpe<PI{ŽN0");

         iBSTrend=false;

         return;

        }

      if(GetHoldingbuyOrdersCount()>0 && GetHoldingsellOrdersCount()==0.0)//

        {

         if(bstrend<imbfxTmin)

           {

            xunhuanquanpingcang();

            iBSTrend=false;

            Print("BSTrendch \ŽN",iBSTrendmin,"YUSꁨRs^ÓN ",bstrend);

           }

        }

      else

        {

         if(GetHoldingbuyOrdersCount()==0.0 && GetHoldingsellOrdersCount()>0)//

           {

            if(bstrend>iBSTrendmax)

              {

               xunhuanquanpingcang();

               iBSTrend=false;

               Print("BSTrendch 'YŽN",iBSTrendmax,"zzUSꁨRs^ÓN ",bstrend);

              }

           }

         else

           {

            comment("¡l¢‹USbYzzUSý	g àeÕl/T¨Rchs^ÓN");

            Print("¡l¢‹USbYzzUSý	g àeÕl/T¨Rchs^ÓN");

           }

        }

     }

//----

   if(dingdanxianshi && timeGMTYesNo2 && timeGMT2==D'1970.01.01 00:00:00')//š[öehV2 åe×_‡eW[Ðc:y š[öe Rd– Time0

     {

      timeGMT2=TimeGMT();

      //Print("š[öehV2/T(u ‡eW[Ðc:y ",TimeGMT());

     }

   else

     {

      if(timeGMTYesNo2 && TimeGMT()>=timeGMT2+timeGMTSeconds2)

        {

         //Print("š[öehV2öeô•0R Yt-N . . . ",TimeGMT());

         /////////////////////////////////////////////////////////////////////////////////////////////////



         if(NormalizeDouble(CGetbuyLots(),2)==NormalizeDouble(CGetsellLots(),2))//‚Yœg¢‹USÍS•öe 
NgbLˆbkÈvbk_c ꁨRReks^ÓN

           {

            fansuoYes=true;

           }

         else

           {

            fansuoYes=false;

           }

         if(ObjectFind("zi")>=0)

            ObjectDelete("zi");

         if(ObjectFind("zi1")>=0)

            ObjectDelete("zi1");

         buydangeshu=0;

         selldangeshu=0;

         dingdanshu=10;

         dingdanshu1=dingdangeshu10;

         dingdanshu1=dingdangeshu10nom;

         dingdanshu2=zhinengSLTPdingdangeshu;

         guadangeshu=huaxianguadangeshu;

         huaxianguadanlotsT=huaxianguadanlots;



         diancha=MarketInfo(Symbol(),MODE_SPREAD)*Point;

         pianyilingGlo=pianyiglo*Point;//hQ@\OPûyϑ 
N(u*Pointÿ



         //Print(diancha," ",pianyiling," ",Point);

         if(ObjectFind(0,"SLbuyQpengcangline")==0)

           {

            SLbuyQpengcangline=NormalizeDouble(ObjectGet("SLbuyQpengcangline",1),Digits);  //š[öeôf°e*j¿~„v÷N<h

           }

         if(ObjectFind(0,"SLsellQpengcangline")==0)

           {

            SLsellQpengcangline=NormalizeDouble(ObjectGet("SLsellQpengcangline",1),Digits);  //š[öeôf°e*j¿~„v÷N<h

           }

         ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

         //---

         if(SLbuylineQpingcang)//

           {

            if(GetHoldingbuyOrdersCount()>0)

              {

               if(ObjectFind("SLsellQpengcangline")==0)

                 {

                  SLsellQpengcangline=HoldingOrderbuyAvgPrice()+SL5QTPpingcang*Point;

                  ObjectMove(0,"SLsellQpengcangline",0,Time[0],SLsellQpengcangline);

                 }

               else

                 {

                  SetLevel("SLsellQpengcangline",Bid+200*Point,DarkSlateGray);

                  SLsellQpengcangline=Bid+200*Point;

                 }

              }

           }

         if(SLselllineQpingcang)//

           {

            if(GetHoldingsellOrdersCount()>0)

              {

               if(ObjectFind("SLbuyQpengcangline")==0)

                 {

                  SLbuyQpengcangline=HoldingOrdersellAvgPrice()-SL5QTPpingcang*Point;

                  ObjectMove(0,"SLbuyQpengcangline",0,Time[0],SLbuyQpengcangline);

                 }

               else

                 {

                  SetLevel("SLbuyQpengcangline",Ask-200*Point,DarkSlateGray);

                  SLbuyQpengcangline=Ask-200*Point;

                 }

              }

           }

         //---<

         ////

         if(SLbuylineQpingcang1)//

           {

            if(GetHoldingbuyOrdersCount()>0)

              {

               if(ObjectFind("SLsellQpengcangline1")==0)

                 {

                  SLsellQpengcangline1=HoldingOrderbuyAvgPrice()+SL5QTPpingcang1*Point;

                  ObjectMove(0,"SLsellQpengcangline1",0,Time[0],SLsellQpengcangline1);

                 }

               else

                 {

                  SetLevel("SLsellQpengcangline1",Bid+200*Point,DarkSlateGray);

                  SLsellQpengcangline1=Bid+200*Point;

                 }

              }

           }

         if(SLselllineQpingcang1)//

           {

            if(GetHoldingsellOrdersCount()>0)

              {

               if(ObjectFind("SLbuyQpengcangline1")==0)

                 {

                  SLbuyQpengcangline1=HoldingOrdersellAvgPrice()-SL5QTPpingcang1*Point;

                  ObjectMove(0,"SLbuyQpengcangline1",0,Time[0],SLbuyQpengcangline1);

                 }

               else

                 {

                  SetLevel("SLbuyQpengcangline1",Ask-200*Point,DarkSlateGray);

                  SLbuyQpengcangline1=Ask-200*Point;

                 }

              }

           }



         ///



         if(SL1mbuyLine)//NRŸ”bk_c*j¿~

           {

            RefreshRates();

            if(ObjectFind("SL1mbuyLine")==0)

              {

               SL1mbuyLineprice1=iLow(NULL,PERIOD_M1,iLowest(NULL,PERIOD_M1,MODE_LOW,SL1mlinetimeframe,0))-SLbuylinepianyi*Point;

               if(SL1mbuyLineprice1>=SL1mbuyLineprice)

                  SL1mbuyLineprice=SL1mbuyLineprice1;

               ObjectMove("SL1mbuyLine",0,Time[3],SL1mbuyLineprice);

              }

            else

              {

               SL1mbuyLineprice=iLow(NULL,PERIOD_M1,iLowest(NULL,PERIOD_M1,MODE_LOW,SL1mlinetimeframe,0))-SLbuylinepianyi*Point;

               SetLevel("SL1mbuyLine",SL1mbuyLineprice,Maroon);

              }

           }







         if(SL1msellLine)

           {

            RefreshRates();

            if(ObjectFind("SL1msellLine")==0)

              {

               SL1msellLineprice1=iHigh(NULL,PERIOD_M1,iHighest(NULL,PERIOD_M1,MODE_HIGH,SL1mlinetimeframe,0))+SLselllinepianyi*Point;

               if(SL1msellLineprice1<=SL1msellLineprice)

                  SL1msellLineprice=SL1msellLineprice1;

               ObjectMove("SL1msellLine",0,Time[3],SL1msellLineprice);

              }

            else

              {

               SL1msellLineprice=iHigh(NULL,PERIOD_M1,iHighest(NULL,PERIOD_M1,MODE_HIGH,SL1mlinetimeframe,0))+SLselllinepianyi*Point;

               SetLevel("SL1msellLine",SL1msellLineprice,Maroon);

              }

           }







         if(SL5mbuyLine)//”NRŸ”bk_c*j¿~

           {

            RefreshRates();

            if(ObjectFind("SL5mbuyLine")==0)

              {

               SL5mbuyLineprice1=iLow(NULL,PERIOD_M5,iLowest(NULL,PERIOD_M5,MODE_LOW,SL5mlinetimeframe,0))-SLbuylinepianyi*Point;

               if(SL5mbuyLineprice1>=SL5mbuyLineprice)

                  SL5mbuyLineprice=SL5mbuyLineprice1;

               ObjectMove("SL5mbuyLine",0,Time[3],SL5mbuyLineprice);

              }

            else

              {

               SL5mbuyLineprice=iLow(NULL,PERIOD_M5,iLowest(NULL,PERIOD_M5,MODE_LOW,SL5mlinetimeframe,0))-SLbuylinepianyi*Point;

               SetLevel("SL5mbuyLine",SL5mbuyLineprice,Maroon);

              }

           }







         if(SL5msellLine)

           {

            RefreshRates();

            if(ObjectFind("SL5msellLine")==0)

              {

               SL5msellLineprice1=iHigh(NULL,PERIOD_M5,iHighest(NULL,PERIOD_M5,MODE_HIGH,SL5mlinetimeframe,0))+SLselllinepianyi*Point;

               if(SL5msellLineprice1<=SL5msellLineprice)

                  SL5msellLineprice=SL5msellLineprice1;

               ObjectMove("SL5msellLine",0,Time[3],SL5msellLineprice);

              }

            else

              {

               SL5msellLineprice=iHigh(NULL,PERIOD_M5,iHighest(NULL,PERIOD_M5,MODE_HIGH,SL5mlinetimeframe,0))+SLselllinepianyi*Point;

               SetLevel("SL5msellLine",SL5msellLineprice,Maroon);

              }

           }







         if(SL15mbuyLine)//AS”NRŸ”bk_c*j¿~

           {

            RefreshRates();

            if(ObjectFind("SL15mbuyLine")==0)

              {

               SL15mbuyLineprice1=iLow(NULL,PERIOD_M15,iLowest(NULL,PERIOD_M15,MODE_LOW,SL15mlinetimeframe,0))-SLbuylinepianyi*Point;

               if(SL15mbuyLineprice1>=SL15mbuyLineprice)

                  SL15mbuyLineprice=SL15mbuyLineprice1;

               ObjectMove("SL15mbuyLine",0,Time[3],SL15mbuyLineprice);

              }

            else

              {

               SL15mbuyLineprice=iLow(NULL,PERIOD_M15,iLowest(NULL,PERIOD_M15,MODE_LOW,SL15mlinetimeframe,0))-SLbuylinepianyi*Point;;

               SetLevel("SL15mbuyLine",SL15mbuyLineprice,Maroon);

              }

           }







         if(SL15msellLine)

           {

            RefreshRates();

            if(ObjectFind("SL15msellLine")==0)

              {

               SL15msellLineprice1=iHigh(NULL,PERIOD_M15,iHighest(NULL,PERIOD_M15,MODE_HIGH,SL15mlinetimeframe,0))+SLselllinepianyi*Point;

               if(SL15msellLineprice1<=SL15msellLineprice)

                  SL15msellLineprice=SL15msellLineprice1;

               ObjectMove("SL15msellLine",0,Time[3],SL15msellLineprice);

              }

            else

              {

               SL15msellLineprice=iHigh(NULL,PERIOD_M15,iHighest(NULL,PERIOD_M15,MODE_HIGH,SL15mlinetimeframe,0))+SLselllinepianyi*Point;

               SetLevel("SL15msellLine",SL15msellLineprice,Maroon);

              }

           }



         //---



         timeGMT2=TimeGMT();

        }

     }

   if(Lots()!=0.0)

      timertrue=false;

//Print("timertrue1=",timertrue);

   if(timertrue)

      return;







   /*Print("timertrue2=",timertrue);

      if(huaxianSwitch && Lots()==0.0)//R¿~s^ÓN
N(u„v

        {

         // Print(" RR¿~s^ÓN„v‹¿R¿~");

         if(ObjectFind(TPObjName)>=0) ObjectDelete(TPObjName);

         if(ObjectFind(SLObjName)>=0) ObjectDelete(SLObjName);

         if(ObjectFind(TP_PRICE_LINE)>=0) ObjectDelete(TP_PRICE_LINE);

         if(ObjectFind(SL_PRICE_LINE)>=0) ObjectDelete(SL_PRICE_LINE);

        }

   // Print("Lots=",Lots());*/

   if(OrdersTotal()==0 || Lots()==0.0)

     {

      //Print(" Ræ]
N҉‡eW[");

      if(ObjectFind("buy")>=0)

         ObjectDelete("buy");

      if(ObjectFind("sell")>=0)

         ObjectDelete("sell");

      if(ObjectFind("buysell")>=0)

         ObjectDelete("buysell");

      if(ObjectFind("AccountEquity")>=0)

         ObjectDelete("AccountEquity");

      if(ObjectFind("AccountFreeMargin")>=0)

         ObjectDelete("AccountFreeMargin");

      if(ObjectFind("zi")>=0)

         ObjectDelete("zi");

      timertrue=true;

      //Print("timertrue3=",timertrue);

      return;

     }

// Print("¡‹öehVЏLˆ");

   if(dingdanxianshi)//¢‹USáOo`>f:y(WþVhˆ

     {

      if(ObjectFind("buy")<0)

        {

         ObjectCreate(0,"buy",OBJ_LABEL,0,0,0);

         ObjectSetInteger(0,"buy",OBJPROP_CORNER,CORNER_LEFT_UPPER);

         ObjectSetInteger(0,"buy",OBJPROP_XDISTANCE,dingdanxianshiX);

         ObjectSetInteger(0,"buy",OBJPROP_YDISTANCE,dingdanxianshiY);

         ObjectSetText("buy","YUS:"+string(GetHoldingbuyOrdersCount())+"*N"+" qQ"+string(NormalizeDouble(CGetbuyLots(),2))+"Kb"+" GW÷N "+string(NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)),12,"ўSO",dingdanxianshicolor);

        }

      else

        {

         if(gloxianshijunjian)

           {

            ObjectSetText("buy","YUS:"+string(GetHoldingbuyOrdersCount())+"*N"+" qQ"+string(NormalizeDouble(CGetbuyLots(),2))+"Kb"+" GW÷N "+string(NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)),12,"ўSO",dingdanxianshicolor);

           }

         else

           {

            ObjectSetText("buy","YUS:"+string(GetHoldingbuyOrdersCount())+"*N"+" qQ"+string(NormalizeDouble(CGetbuyLots(),2))+"Kb",12,"ўSO",dingdanxianshicolor);

           }



        }

      if(ObjectFind("sell")<0)

        {

         ObjectCreate(0,"sell",OBJ_LABEL,0,0,0);

         ObjectSetInteger(0,"sell",OBJPROP_CORNER,CORNER_LEFT_UPPER);

         ObjectSetInteger(0,"sell",OBJPROP_XDISTANCE,dingdanxianshiX);

         ObjectSetInteger(0,"sell",OBJPROP_YDISTANCE,dingdanxianshiY+20);

         ObjectSetText("sell","zzUS:"+string(GetHoldingsellOrdersCount())+"*N"+" qQ"+string(NormalizeDouble(CGetsellLots(),2))+"Kb"+" GW÷N "+string(NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)),12,"ўSO",dingdanxianshicolor);

        }

      else

        {

         if(gloxianshijunjian)

           {

            ObjectSetText("sell","zzUS:"+string(GetHoldingsellOrdersCount())+"*N"+" qQ"+string(NormalizeDouble(CGetsellLots(),2))+"Kb"+" GW÷N "+string(NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)),12,"ўSO",dingdanxianshicolor);

           }

         else

           {

            ObjectSetText("sell","zzUS:"+string(GetHoldingsellOrdersCount())+"*N"+" qQ"+string(NormalizeDouble(CGetsellLots(),2))+"Kb",12,"ўSO",dingdanxianshicolor);

           }



        }

      if(ObjectFind("buysell")<0)

        {

         ObjectCreate(0,"buysell",OBJ_LABEL,0,0,0);

         ObjectSetInteger(0,"buysell",OBJPROP_CORNER,CORNER_LEFT_UPPER);

         ObjectSetInteger(0,"buysell",OBJPROP_XDISTANCE,dingdanxianshiX);

         ObjectSetInteger(0,"buysell",OBJPROP_YDISTANCE,dingdanxianshiY+40);

         ObjectSetText("buysell","buylimit "+string(GetHoldingguadanbuylimitOrdersCount())+" buystop "+string(GetHoldingguadanbuystopOrdersCount())+" selllimit "+string(GetHoldingguadanselllimitOrdersCount())+" sellstop "+string(GetHoldingguadansellstopOrdersCount()),12,"ўSO",dingdanxianshicolor);

        }







      else

        {

         ObjectSetText("buysell","buylimit "+string(GetHoldingguadanbuylimitOrdersCount())+" buystop "+string(GetHoldingguadanbuystopOrdersCount())+" selllimit "+string(GetHoldingguadanselllimitOrdersCount())+" sellstop "+string(GetHoldingguadansellstopOrdersCount()),12,"ўSO",dingdanxianshicolor);

        }

      /*

            if(ObjectFind("AccountEquity")<0)

              {

               ObjectCreate(0,"AccountEquity",OBJ_LABEL,0,0,0);

               ObjectSetInteger(0,"AccountEquity",OBJPROP_CORNER,CORNER_LEFT_UPPER);

               ObjectSetInteger(0,"AccountEquity",OBJPROP_XDISTANCE,dingdanxianshiX);

               ObjectSetInteger(0,"AccountEquity",OBJPROP_YDISTANCE,dingdanxianshiY+60);

               ObjectSetText("AccountEquity","&7bÀQ<P:"+DoubleToString(NormalizeDouble(AccountEquity(),2),2)+" "+AccountCurrency(),12,"ўSO",dingdanxianshicolor);

              }

            else

              {

               ObjectSetText("AccountEquity","&7bÀQ<P:"+DoubleToString(NormalizeDouble(AccountEquity(),2),2)+" "+AccountCurrency(),12,"ўSO",dingdanxianshicolor);

              }

              */

      if(ObjectFind("AccountFreeMargin")<0)

        {

         ObjectCreate(0,"AccountFreeMargin",OBJ_LABEL,0,0,0);

         ObjectSetInteger(0,"AccountFreeMargin",OBJPROP_CORNER,CORNER_LEFT_UPPER);

         ObjectSetInteger(0,"AccountFreeMargin",OBJPROP_XDISTANCE,dingdanxianshiX);

         ObjectSetInteger(0,"AccountFreeMargin",OBJPROP_YDISTANCE,dingdanxianshiY+80);

         ObjectSetText("AccountFreeMargin","ïS(uÝOÁ‹Ñ‘:"+DoubleToString(NormalizeDouble(AccountFreeMargin(),2),2)+" "+AccountCurrency(),12,"ўSO",dingdanxianshicolor);

        }

      else

        {

         ObjectSetText("AccountFreeMargin","ïS(uÝOÁ‹Ñ‘:"+DoubleToString(NormalizeDouble(AccountFreeMargin(),2),2)+" "+AccountCurrency(),12,"ўSO",dingdanxianshicolor);

        }

      if(ObjectFind("botoupi")<0)

        {

         ObjectCreate(0,"botoupi",OBJ_LABEL,0,0,0);

         ObjectSetInteger(0,"botoupi",OBJPROP_CORNER,CORNER_LEFT_UPPER);

         ObjectSetInteger(0,"botoupi",OBJPROP_XDISTANCE,dingdanxianshiX);

         ObjectSetInteger(0,"botoupi",OBJPROP_YDISTANCE,dingdanxianshiY+100);

         if(Tickmode)

           {

            ObjectSetText("botoupi","eR4Y®v!j_ /T(u",12,"ўSO",dingdanxianshicolor);

           }

         else

           {

            ObjectDelete(0,"botoupi");

           }

        }

      else

        {

         if(Tickmode)

           {

            ObjectSetText("botoupi","eR4Y®v!j_ /T(u",12,"ўSO",dingdanxianshicolor);

           }

         else

           {

            ObjectDelete(0,"botoupi");

           }

        }



      if(imbfxT)

        {

         if(ObjectFind("MBFX")<0)

           {

            ObjectCreate(0,"MBFX",OBJ_LABEL,0,0,0);

            ObjectSetInteger(0,"MBFX",OBJPROP_CORNER,CORNER_LEFT_UPPER);

            ObjectSetInteger(0,"MBFX",OBJPROP_XDISTANCE,dingdanxianshiX);

            ObjectSetInteger(0,"MBFX",OBJPROP_YDISTANCE,dingdanxianshiY+120);

            ObjectSetText("MBFX","MBFXchs^ÓN/T(u",12,"ўSO",dingdanxianshicolor);

           }

        }

      else

        {

         if(ObjectFind(0,"MBFX")==0)

            ObjectDelete(0,"MBFX");

        }

      if(iBSTrend)

        {

         if(ObjectFind("iBSTrend")<0)

           {

            ObjectCreate(0,"iBSTrend",OBJ_LABEL,0,0,0);

            ObjectSetInteger(0,"iBSTrend",OBJPROP_CORNER,CORNER_LEFT_UPPER);

            ObjectSetInteger(0,"iBSTrend",OBJPROP_XDISTANCE,dingdanxianshiX);

            ObjectSetInteger(0,"iBSTrend",OBJPROP_YDISTANCE,dingdanxianshiY+140);

            ObjectSetText("iBSTrend","BSTrendchs^ÓN/T(u",12,"ўSO",dingdanxianshicolor);

           }

        }

      else

        {

         if(ObjectFind(0,"iBSTrend")==0)

            ObjectDelete(0,"iBSTrend");

        }

     }

   if(EAswitch==false)

      return;







   if(linebuypingcangC)//æ‰ÊS*j¿~hQs^ÓN š[öehV

     {

      // Print("æ‰ÊS*j¿~hQs^ÓN š[öehV");

      if(buyline<buylineOnTimer && buyline>=Bid)//*j¿~(WS_MR÷NKNN

        {

         xunhuanquanpingcang();

         linebuypingcangC=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }



      if(buyline>buylineOnTimer && buyline<=Bid)//*j¿~(WS_MR÷NKN
N

        {

         xunhuanquanpingcang();

         linebuypingcangC=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }

     }



   if(linesellpingcangC)//æ‰ÊS*j¿~hQs^ÓN š[öehV

     {

      //Print("æ‰ÊS*j¿~hQs^ÓN š[öehV");

      if(sellline>selllineOnTimer && sellline<=Bid)//*j¿~(WS_MR÷NKN
N

        {

         xunhuanquanpingcang();

         linesellpingcangC=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }

      if(sellline<selllineOnTimer && sellline>=Bid)//*j¿~(WS_MR÷NKNN

        {

         xunhuanquanpingcang();

         linesellpingcangC=false;

         linelock=false;

         if(ObjectFind(0,"Buy Line")==0)

            ObjectDelete(0,"Buy Line");

         if(ObjectFind(0,"Sell Line")==0)

            ObjectDelete(0,"Sell Line");

        }

     }

   if(timeGMTYesNo1 && timeGMT1==D'1970.01.01 00:00:00')//š[öehV1 eaꁨRbkÈvbk_c;Nz^ Time1

     {

      timeGMT1=TimeGMT();

      //Print("š[öehV1/T(u ",TimeGMT());

     }

   else

     {

      if(timeGMTYesNo1 && TimeGMT()>=timeGMT1+timeGMTSeconds1)

        {

         //Print("š[öehV1öeô•0R eaꁨRbkÈvbk_c;Nz^ Yt-N . . . ",TimeGMT());

         ///////////////////////////////////////////////////////////////////////////////////// c`—š[öehVgbLˆ„vøvsQãNx

         if(linelock==false)//*j¿~!j_gbLˆT n:W

           {

            linebuykaicang=false;

            linesellkaicang=false;

            linekaicangshiftR=false;

            linekaicangT=false;

            linebuypingcang=false;

            linebuypingcangR=false;

            linebuypingcangC=false;

            linesellpingcang=false;

            linesellpingcangR=false;

            linesellpingcangC=false;

           }

         shangpress=0;

         xiapress=0;

         leftpress=0;

         rightpress=0;//nd–¹eT.•	cN!kpe c`—š[öehV1gbLˆ

         keylotshalf=keylots;

         SLlinepingcangjishu1=0;//

         buydangeshu=GetHoldingbuyOrdersCount();

         selldangeshu=GetHoldingsellOrdersCount();//š[öeôf°e¢‹US*Npe c`—š[öehV1gbLˆ

         bkey=false;

         skey=false;

         tkey=false;

         lkey=false;

         pkey=false;

         kkey=false;

         okey=false;

         akey=false;

         shiftR=false;

         tab=false;//š[öend–	c.•¶r` c`—š[öehV1gbLˆ

         ////////////////////////////////////////////////////////////////////////////////////////////////////

         if(GetLastError()==129)

           {

            linebuykaicang=false;

            linesellkaicang=false;

            if(ObjectFind(0,"Buy Line")==0)

               ObjectDelete(0,"Buy Line");

            if(ObjectFind(0,"Sell Line")==0)

               ObjectDelete(0,"Sell Line");

           }

         /////////////////////////////////////////////////////////////////////////////

         if(EAswitch==false)

            return;

         if(fansuoYes)

            return;//‚YœgÍS•¢‹USöe 
NgbLˆê¨RbkÈvbk_c

         for(int cnt=0; cnt<OrdersTotal(); cnt++) //eabkÈvbk_c;Nz^

           {

            if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

              {

               if(OrderSymbol()==Symbol() && autosttp)

                 {

                  double stp=OrderStopLoss();

                  double tpt=OrderTakeProfit();

                  double OpenPrice=OrderOpenPrice();



                  if(OriginalLot==0)

                    {

                     OriginalLot=OrderLots();

                    }

                  if(OrderType()==OP_BUY)

                    {

                     if(AutoStoploss && AutoTakeProfit && stp==0 && tpt==0)

                        bool a1=OrderModify(OrderTicket(),OrderOpenPrice(),OpenPrice-Point*stoploss,OpenPrice+Point*takeprofit,0,CLR_NONE);

                     else

                       {

                        if(AutoStoploss && stp==0)

                          {

                           bool a2=OrderModify(OrderTicket(),OrderOpenPrice(),OpenPrice-Point*stoploss,OrderTakeProfit(),0,CLR_NONE);

                          }



                        if(AutoTakeProfit && tpt==0)

                          {

                           bool a3=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OpenPrice+Point*takeprofit,0,CLR_NONE);

                          }



                        if(AutoTrailingStop && ((Bid-OpenPrice)>Point*TrailingStop))

                          {

                           if((Bid-stp)>TrailingStop*Point)

                              bool a4=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,CLR_NONE);

                          }

                       }

                    }

                  if(OrderType()==OP_SELL)

                    {



                     if(AutoStoploss && AutoTakeProfit && stp==0 && tpt==0)

                        bool a5=OrderModify(OrderTicket(),OrderOpenPrice(),OpenPrice+Point*stoploss,OpenPrice-Point*takeprofit,0,CLR_NONE);

                     else

                       {

                        if(AutoStoploss && stp==0)

                          {

                           bool a6=OrderModify(OrderTicket(),OrderOpenPrice(),OpenPrice+Point*stoploss,OrderTakeProfit(),0,CLR_NONE);

                          }

                        if(AutoTakeProfit && tpt==0)

                          {

                           bool a7=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OpenPrice-Point*takeprofit,0,CLR_NONE);

                          }



                        if(AutoTrailingStop && ((OpenPrice-Ask)>Point*TrailingStop))

                          {

                           if((stp-Ask)>TrailingStop*Point)

                              bool a8=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,CLR_NONE);

                          }

                       }

                    }

                 }

              }

            else

              {

               OriginalLot=0;

              }

           }

         timeGMT1=TimeGMT();

        }

     }







   if(timeGMTYesNo3 && timeGMT3==D'1970.01.01 00:00:00')//š[öehV3

     {

      timeGMT3=TimeGMT();

      Print("š[öehV3/T(u ",TimeLocal());

     }

   else

     {

      if(timeGMTYesNo3 && TimeGMT()>=timeGMT3+timeGMTSeconds3)

        {

         //Print("š[öehV3öeô•0R Yt-N . . . ",TimeGMT());

         if(buytrue03)

           {

            if(GetiLowest(timeframe03,bars03,beginbar03)-pianyiliang03*Point<timebuyprice)

              {

               Print("
NTûySL");

              }

            else

              {

               PiliangSL(buytrue03,GetiLowest(timeframe03,bars03,beginbar03),jianju03,pianyiliang03,juxianjia03,dingdangeshu03);

               timebuyprice=GetiLowest(timeframe03,bars03,beginbar03)-pianyiliang03*Point;

              }

           }

         else

           {

            if(GetiHighest(timeframe03,bars03,beginbar03)+pianyiliang03*Point>timesellprice)

              {

               Print("
NTûySL");

              }

            else

              {

               PiliangSL(buytrue03,GetiHighest(timeframe03,bars03,beginbar03),jianju03,pianyiliang03,juxianjia03,dingdangeshu03);

               timesellprice=GetiHighest(timeframe03,bars03,beginbar03)+pianyiliang03*Point;

              }

           }

         //juxianjiadingshi03=true;

         timeGMT3=TimeGMT();

        }

     }







   if(timeGMTYesNo4 && timeGMT4==D'1970.01.01 00:00:00')//š[öehV4

     {

      timeGMT4=TimeGMT();

      Print("š[öehV4/T(u ",TimeLocal());

     }







   else

     {

      if(timeGMTYesNo4 && TimeGMT()>=timeGMT4+timeGMTSeconds4)

        {

         Print("š[öehV4öeô•0R Yt-N . . . ",TimeLocal());

         if(buytrue04)

           {

            PiliangTP(buytrue04,GetiHighest(timeframe04,bars04,beginbar04),jianju04,pianyiliang04tp,juxianjia04,dingdangeshu04);

           }

         else

           {

            PiliangTP(buytrue04,GetiLowest(timeframe04,bars04,beginbar04),jianju04,pianyiliang04tp,juxianjia04,dingdangeshu04);

           }

         //juxianjiadingshi03=true;

         timeGMT4=TimeGMT();

        }

     }







   if(timeGMTYesNo5 && timeGMT5==D'1970.01.01 00:00:00')//š[öehV5

     {

      timeGMT5=TimeGMT();

      Print("š[öehV5/T(u ",TimeLocal());

     }







   else

     {

      if(timeGMTYesNo5 && TimeGMT()>=timeGMT5+timeGMTSeconds5)

        {

         Print("š[öehV5öeô•0R Yt-N . . . ",TimeLocal());

         if(buytrue05)

           {

            PiliangSL(buytrue05,GetiLowest(dingshitimeframe05,dingshibars05,dingshibeginbar05),dingshijianju05,dingshipianyiliang05,dingshijuxianjia05,dingshidingdangeshu05);

           }

         else

           {

            PiliangSL(buytrue05,GetiHighest(dingshitimeframe05,dingshibars05,dingshibeginbar05),dingshijianju05,dingshipianyiliang05,dingshijuxianjia05,dingshidingdangeshu05);

           }

         //juxianjiadingshi03=true;

         timeGMT5=TimeGMT();

        }

     }







   if(timeGMTYesNo6 && timeGMT6==D'1970.01.01 00:00:00')//š[öehV6

     {

      timeGMT6=TimeGMT();

      Print("š[öehV6/T(u ",TimeLocal());

     }







   else

     {

      if(timeGMTYesNo6 && TimeGMT()>=timeGMT6+timeGMTSeconds6)

        {

         Print("š[öehV6öeô•0R Yt-N . . . ",TimeLocal());

         if(buytrue06)

           {

            PiliangTP(buytrue06,GetiHighest(dingshitimeframe06,dingshibars06,dingshibeginbar06),dingshijianju06,dingshipianyiliang06tp,dingshijuxianjia06,dingshidingdangeshu06);

           }

         else

           {

            PiliangTP(buytrue06,GetiLowest(dingshitimeframe06,dingshibars06,dingshibeginbar06),dingshijianju06,dingshipianyiliang06tp,dingshijuxianjia06,dingshidingdangeshu06);

           }

         //juxianjiadingshi03=true;

         timeGMT6=TimeGMT();

        }

     }



   if(Tickmode==true)//Tick!j_‚Yœg/T(u

     {

      return;

     }

   else

     {

      if(EAswitch==false)

         return;

      if(fansuoYes)

         return;

      for(int i=0; i<OrdersTotal(); i++)

        {

         if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

           {

            int ti=OrderTicket();

            double open=OrderOpenPrice();

            string zhushi=OrderComment();

            if(Gradually==true && OrderSymbol()==Symbol() && OrderType()==OP_BUY && Bid>=OrderOpenPrice()+TrailingStop*Point)

              {

               string from=StringSubstr(OrderComment(),0,4);

               if(zhushi=="" || from!="from")

                 {

                  bool oc=OrderClose(OrderTicket(),NormalizeDouble(OrderLots()/GraduallyNum,xiaoshudian),Bid,slippage);

                  if(oc==true)

                     PlaySound("ok.wav");

                 }

               else

                 {

                  int ticket=StrToInteger(StringSubstr(OrderComment(),6,0));

                  if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_HISTORY)==true)

                    {

                     double hlot=OrderLots();

                     double hcp=OrderClosePrice();

                     double bid=open+TrailingStop*Point;

                     for(int n=GraduallyNum; n>0; n--)

                       {

                        bid+=NormalizeDouble((takeprofit-TrailingStop)/(GraduallyNum-1),0)*Point;

                        if(Bid>=bid && bid>=hcp+minTP*Point)

                          {

                           bool oc=OrderClose(ti,hlot,Bid,slippage,CLR_NONE);

                           if(oc==true)

                             {

                              PlaySound("ok.wav");

                              break;

                             }

                          }

                       }

                    }

                 }

              }

            if(Gradually==true && OrderSymbol()==Symbol() && OrderType()==OP_SELL && Ask<=OrderOpenPrice()-TrailingStop*Point)

              {

               string from=StringSubstr(OrderComment(),0,4);

               if(zhushi=="" || from!="from")

                 {

                  bool oc=OrderClose(OrderTicket(),NormalizeDouble(OrderLots()/GraduallyNum,xiaoshudian),Ask,slippage);

                  if(oc==true)

                     PlaySound("ok.wav");

                 }

               else

                 {

                  int ticket=StrToInteger(StringSubstr(OrderComment(),6,0));

                  if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_HISTORY)==true)

                    {

                     double hlot=OrderLots();

                     double hcp=OrderClosePrice();

                     double ask=open-TrailingStop*Point;

                     for(int n=GraduallyNum; n>0; n--)

                       {

                        ask-=NormalizeDouble((takeprofit-TrailingStop)/(GraduallyNum-1),0)*Point;

                        if(Ask<=ask && ask<=hcp-minTP*Point)

                          {

                           bool oc=OrderClose(ti,hlot,Ask,slippage,CLR_NONE);

                           if(oc==true)

                             {

                              PlaySound("ok.wav");

                              break;

                             }

                          }

                       }

                    }

                 }

              }

           }

        }

     }

  }



//Ó~_g Nb—öeꁚ[INýQpe

double Lots()//S_MR'^ù[„v¢‹US;`pe 
N+TcUS

  {

   double lots=0.0;

   for(int  i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol())

           {

            if(OrderType()==OP_BUY || OrderType()==OP_SELL)

              {

               lots+=OrderLots();

              }

           }

     }

   return(lots);

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void closecode()//Reks^ÓN

  {

// Print("closecodeýQpeЏLˆ");

   for(int i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         int ti=OrderTicket();

         double open=OrderOpenPrice();

         string zhushi=OrderComment();

         if(Gradually==true && OrderSymbol()==Symbol() && OrderType()==OP_BUY && Bid>=OrderOpenPrice()+TrailingStop*Point)

           {

            string from=StringSubstr(OrderComment(),0,4);

            if(zhushi=="" || from!="from")

              {

               bool oc=OrderClose(OrderTicket(),NormalizeDouble(OrderLots()/GraduallyNum,xiaoshudian),Bid,slippage);

               if(oc==true)

                  PlaySound("ok.wav");

              }

            else

              {

               int ticket=StrToInteger(StringSubstr(OrderComment(),6,0));

               if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_HISTORY)==true)

                 {

                  double hlot=OrderLots();

                  double hcp=OrderClosePrice();

                  double bid=open+TrailingStop*Point;

                  for(int n=GraduallyNum; n>0; n--)

                    {

                     bid+=NormalizeDouble((takeprofit-TrailingStop)/(GraduallyNum-1),0)*Point;

                     if(Bid>=bid && bid>=hcp+minTP*Point)

                       {

                        bool oc=OrderClose(ti,hlot,Bid,slippage,CLR_NONE);

                        if(oc==true)

                          {

                           PlaySound("ok.wav");

                           break;

                          }

                       }

                    }

                 }

              }

           }

         if(Gradually==true && OrderSymbol()==Symbol() && OrderType()==OP_SELL && Ask<=OrderOpenPrice()-TrailingStop*Point)

           {

            string from=StringSubstr(OrderComment(),0,4);

            if(zhushi=="" || from!="from")

              {

               bool oc=OrderClose(OrderTicket(),NormalizeDouble(OrderLots()/GraduallyNum,xiaoshudian),Ask,slippage);

               if(oc==true)

                  PlaySound("ok.wav");

              }

            else

              {

               int ticket=StrToInteger(StringSubstr(OrderComment(),6,0));

               if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_HISTORY)==true)

                 {

                  double hlot=OrderLots();

                  double hcp=OrderClosePrice();

                  double ask=open-TrailingStop*Point;

                  for(int n=GraduallyNum; n>0; n--)

                    {

                     ask-=NormalizeDouble((takeprofit-TrailingStop)/(GraduallyNum-1),0)*Point;

                     if(Ask<=ask && ask<=hcp-minTP*Point)

                       {

                        bool oc=OrderClose(ti,hlot,Ask,slippage,CLR_NONE);

                        if(oc==true)

                          {

                           PlaySound("ok.wav");

                           break;

                          }

                       }

                    }

                 }

              }

           }

        }

     }

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zuizaokeyclose()//s^géeN„vNUS

  {

// for(int cnt=OrdersTotal()-1;cnt>=0;cnt--)

   for(int cnt=0; cnt<OrdersTotal(); cnt++)

























     {

      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderType()==OP_BUY && OrderSymbol()==Symbol())

           {

            // Print(OrderTicket()," ¢‹US	ébbŸR");

            bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),keyslippage,CLR_NONE);

            if(oc)

              {

               PlaySound("ok.wav");

               return;

              }

            else

              {

               PlaySound("timeout.wav");

               Print("Error=",GetLastError());

              }

           }

         else

           {

            if(OrderType()==OP_SELL && OrderSymbol()==Symbol())

              {

               //  Print(OrderTicket()," ¢‹US	ébbŸR");

               bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),keyslippage,CLR_NONE);

               if(oc)

                 {

                  PlaySound("ok.wav");

                  return;

                 }

               else

                 {

                  PlaySound("timeout.wav");

                  Print("Error=",GetLastError());

                 }

              }

           }

        }







      else

        {

         Print("¢‹US	éb1Y%");

         return;

        }

     }

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zuijinkeyclose()//s^gяN„vNUS

  {

   for(int cnt=OrdersTotal()-1; cnt>=0; cnt--)

























      //  for(int cnt=0;cnt<OrdersTotal();cnt++)

     {

      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderType()==OP_BUY && OrderSymbol()==Symbol())

           {

            // Print(OrderTicket()," ¢‹US	ébbŸR");

            bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),keyslippage,CLR_NONE);

            if(oc)

              {

               PlaySound("ok.wav");

               return;

              }

            else

              {

               PlaySound("timeout.wav");

               Print("Error=",GetLastError());

              }

           }

         else

           {

            if(OrderType()==OP_SELL && OrderSymbol()==Symbol())

              {

               //   Print(OrderTicket()," ¢‹US	ébbŸR");

               bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),keyslippage,CLR_NONE);

               if(oc)

                 {

                  PlaySound("ok.wav");

                  return;

                 }

               else

                 {

                  PlaySound("timeout.wav");

                  Print("Error=",GetLastError());

                 }

              }

           }

        }







      else

        {

         Print("¢‹US	éb1Y%");

         return;

        }

     }

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zuidakeyclose()//s^g'Y÷N<h„vNUS

  {

   int ti=0;

   int ty=0;

   int op=0;

   int ticket[200]= {};

   int type[200];

   double openprice[200];

   for(int cnt=OrdersTotal()-1; cnt>=0; cnt--)

























      //  for(int cnt=0;cnt<OrdersTotal();cnt++)

     {

      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol())

           {

            if(OrderType()==0 || OrderType()==1)

              {

               ticket[ti]=OrderTicket();

               openprice[op]=OrderOpenPrice();

               type[ty]=OrderType();

               ti++;

               ty++;

               op++;

              }

           }

     }

   int maxopen=ArrayMaximum(openprice,op,0);

   int minopen=ArrayMinimum(openprice,op,0);

   int maxticket=ticket[maxopen];

   int minticket=ticket[minopen];













   if(OrderSelect(maxticket,SELECT_BY_TICKET)==true)

     {

      //Print(maxticket," ¢‹US	ébbŸR");

      bool oc=OrderClose(maxticket,OrderLots(),OrderClosePrice(),keyslippage,CLR_NONE);







      if(oc==true)

        {

         PlaySound("ok.wav");

         return;

        }

      else

        {

         PlaySound("timeout.wav");

         Print("Error=",GetLastError());

        }

     }

   /*

      if(OrderSelect(minticket,SELECT_BY_TICKET)==true)

        {

         Print(minticket," ¢‹US	ébbŸR");

         bool oc=OrderClose(minticket,OrderLots(),OrderClosePrice(),3,CLR_NONE);

         if(oc==true)

           {

            PlaySound("ok.wav");

            return;

           }

         else PlaySound("timeout.wav");

        }

   */

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zuixiaokeyclose()//s^g\÷N<h„vNUS

  {

   int ti=0;

   int ty=0;

   int op=0;

   int ticket[200]= {};

   int type[200];

   double openprice[200];

   for(int cnt=OrdersTotal()-1; cnt>=0; cnt--)

      //  for(int cnt=0;cnt<OrdersTotal();cnt++)

     {

      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol())

           {

            if(OrderType()==0 || OrderType()==1)

              {

               ticket[ti]=OrderTicket();

               openprice[op]=OrderOpenPrice();

               type[ty]=OrderType();

               ti++;

               ty++;

               op++;

              }

           }

     }

   int maxopen=ArrayMaximum(openprice,op,0);

   int minopen=ArrayMinimum(openprice,op,0);

   int maxticket=ticket[maxopen];

   int minticket=ticket[minopen];













   /*

      if(OrderSelect(maxticket,SELECT_BY_TICKET)==true)

        {

         Print(maxticket," ¢‹US	ébbŸR");

         bool oc=OrderClose(maxticket,OrderLots(),OrderClosePrice(),3,CLR_NONE);

         if(oc==true)

           {

            PlaySound("ok.wav");

            return;

           }

         else PlaySound("timeout.wav");

        }

        */



   if(OrderSelect(minticket,SELECT_BY_TICKET)==true)

     {

      //Print(minticket," ¢‹US	ébbŸR");

      bool oc=OrderClose(minticket,OrderLots(),OrderClosePrice(),keyslippage,CLR_NONE);







      if(oc==true)

        {

         PlaySound("ok.wav");

         return;

        }

      else

        {

         PlaySound("timeout.wav");

         Print("Error=",GetLastError());

        }

     }



  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void xunhuanquanpingcang()//ª_¯sí‹åS„vS_MR'^ù[hQs^ÓN ¡ls^Œ[ONôvs^

  {

   int jishu=0;

   while(xunhuandingdanshu()!=0)

     {

      for(int cnt=OrdersTotal()-1; cnt>=0; cnt--)

         //  for(int cnt=0;cnt<OrdersTotal();cnt++)

        {

         if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

           {

            if(OrderType()==OP_BUY && OrderSymbol()==Symbol())

              {

               // Print(OrderTicket()," ¢‹US	ébbŸR");

               bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,CLR_NONE);

               if(oc)

                 {

                  PlaySound("ok.wav");

                  jishu++;

                 }

               else

                 {

                  PlaySound("timeout.wav");

                  Print("Error=",GetLastError());

                 }

              }

            else

              {

               if(OrderType()==OP_SELL && OrderSymbol()==Symbol())

                 {

                  //   Print(OrderTicket()," ¢‹US	ébbŸR");

                  bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,CLR_NONE);

                  if(oc)

                    {

                     PlaySound("ok.wav");

                     jishu++;

                    }

                  else

                    {

                     PlaySound("timeout.wav");

                     Print("Error=",GetLastError());

                    }

                 }

              }

           }

         else

           {

            Print("¢‹US	éb1Y%");

           }

         if(jishu>=pingcangdingdanshu)

           {

            Print("ò]„˜š[¡‹Rs^ÓNgя„v",jishu,"US ");

            pingcangdingdanshu=1000;

            jishu=0;

            return;

           }

        }

     }

  }







/*

void xunhuanquanpingcangMagic(int xunhuanMagic)//ª_¯sí‹åS„vS_MR'^ù[hQs^ÓN ¡ls^Œ[ONôvs^

  {

   while(xunhuandingdanshu()!=0)

     {

      for(int cnt=OrdersTotal()-1;cnt>=0;cnt--)







         //  for(int cnt=0;cnt<OrdersTotal();cnt++)

        {

         if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

           {

            if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderMagicNumber()==xunhuanMagic)

              {

               // Print(OrderTicket()," ¢‹US	ébbŸR");

               bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,CLR_NONE);

               if(oc)

                 {

                  PlaySound("ok.wav");

                 }

               else{PlaySound("timeout.wav");Print("Error=",GetLastError());}

              }

            else

              {

               if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==xunhuanMagic)

                 {

                  //   Print(OrderTicket()," ¢‹US	ébbŸR");

                  bool oc=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,CLR_NONE);

                  if(oc)

                    {

                     PlaySound("ok.wav");



                    }

                  else{PlaySound("timeout.wav");Print("Error=",GetLastError());}

                 }

              }

           }

         else

           {

            Print("¢‹US	éb1Y%");

           }

        }

     }

  }



  int xunhuandingdanshuMagic()

  {

   int aa=0;

   for(int cntt=OrdersTotal()-1;cntt>=0;cntt--)



     {

      if(OrderSelect(cntt,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderSymbol()==Symbol() && OrderMagicNumber()==xunhuanMagic)

           {

            if(OrderType()==OP_BUY || OrderType()==OP_SELL)

              {

               aa++;

              }

           }

        }

     }

   if(aa==0)Print("hQès^ÓNbŸR");else Print("S_MR'^ù[¢‹USpe ",aa);

   return(aa);

  }





*/









//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int xunhuandingdanshu()

  {

   int aa=0;

   for(int cntt=OrdersTotal()-1; cntt>=0; cntt--)



     {

      if(OrderSelect(cntt,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderSymbol()==Symbol())

           {

            if(OrderType()==OP_BUY || OrderType()==OP_SELL)

              {

               aa++;

              }

           }

        }

     }

   if(aa==0)

      Print("hQès^ÓNbŸR");

   else

      Print("S_MR'^ù[¢‹USpe ",aa);

   return(aa);

  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double getbuySL(double price,int bars) //price S_MR„vpN÷N

  {

   double ATRSL;

   double LowSL;

   ATRSL=price-80*Point+(Ask-Bid); //ATRSL S_MR„vpN÷NÏQ»SY\*N¹pQ R
N¹pî]ÿúVš[bk_c<Pÿ‚Yœg(WNRŸ””NRŸ” íwhTgþVhˆ
NNUS÷‹îO9ebTêñ]„vbk_c<P0

   LowSL=Low[iLowest(NULL,0,MODE_LOW,bars,0)]; //LowSL S_MRþVhˆöeô•hTgNÎNg°e„vN*Nk¿~_ËY€_T(_N1\/f€_æ])pe159hk¿~ÿÖSvQ-N„vgNO¹p„v÷N<h\O:Nbk_c<Pÿ_NïSåNúVš[öeô•hTgÿîO9eNULLTb—„vpe<P0ÿ15ÿ60ÿ240

//LowSL ‚Yœgó`îO9eÖSgNO<P„vÂS€K¿~ƒôVÿ÷‹îO9ePpe,{ŒN*NpeW[ÿPpe,{N*N01\/fÎNg°e„vk¿~_ËYÿ€_æ]pe0RY\9hk¿~Ó~_g0

//Nb—/fZP$R­eÿ9hnc
NT„vagöNԏÞV
NT„vbk_c<P

   if((ATRSL<LowSL) && (ATRSL<=price))

     {

      return(ATRSL);  //‚Yœg^:WYŽN—aƒ-NÿATRSL<LowSL ôv¥cÖSATRSL KNMR¾‹š[„vúVš[bk_c<P0

     }

   else

      if((ATRSL>LowSL) && (LowSL<=price))

        {

         return(LowSL-(Ask-Bid));  //‚YœgYŽNUS¹^:W-Nÿ ATRSL>LowSL ‚YœgATRSL„˜¾‹„vbk_cÔkƒ\ÿO(ug‘˜A~„v1\/fُ*N ÖSLowSL„v<PQÏQ*N¹pî] \O:Nbk_c<P

        }

      else

         if((price<ATRSL) && (price<LowSL))

           {

            return(price-80*Point);  //S_MR¹pî]Ǐ'YÿS_MR„vpN÷N\ŽN„˜¾‹„v$N*Nbk_c<Pÿ£1\ôv¥cÎNS_MRpN÷NpriceÏQ»SY\¹p\O:N°e„vbk_c<P

           }

   return(price-200*Point);

  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double getsellSL(double price,int bars) //price S_MR„vVS÷N

  {

   double ATRSL;

   double HighSL;

   ATRSL=price+80*Point-(Ask-Bid); //ATRSL S_MR„vVS÷N R
NY\*N¹pQ R*N¹pî]ÿúVš[bk_c<Pÿ‚Yœg(WNRŸ””NRŸ” íwhTgþVhˆ
NNUS÷‹îO9ebTêñ]„vbk_c<P0

   HighSL=High[iHighest(NULL,0,MODE_HIGH,bars,0)]; //HighSL S_MRþVhˆöeô•hTgNÎNg°e„vN*Nk¿~_ËY€_T(_N1\/f€_æ])pe159hk¿~ÿÖSvQ-N„vgؚ¹p„v÷N<h\O:Nbk_c<Pÿ_NïSåNúVš[öeô•hTgÿîO9eNULLTb—„vpe<P0ÿ15ÿ60ÿ240

//HighSL ‚Yœgó`îO9eÖSgؚ<P„vÂS€K¿~ƒôVÿ÷‹îO9ePpe,{ŒN*NpeW[ÿPpe,{N*N01\/fÎNg°e„vk¿~_ËYÿ€_æ]pe0RY\9hk¿~Ó~_g0

   if((ATRSL>HighSL) && (ATRSL>=price))

     {

      return(ATRSL);  //‚Yœg^:WYŽN—aƒ-NÿATRSL>HighSL ôv¥cÖSATRSL KNMR¾‹š[„vúVš[bk_c<P0

     }

   else

      if((ATRSL<HighSL) && (HighSL>=price))

        {

         return(HighSL+Ask-Bid+5*Point);  //‚YœgYŽNUS¹^:W-Nÿ ATRSL<HighSL ‚YœgATRSL„˜¾‹„vbk_cÔkƒ\ÿO(ug‘˜A~„v1\/fُ*N ÖSHighSL„v<PQ R*N¹pî] \O:Nbk_c<P

        }

      else

         if((price>ATRSL) && (price>HighSL))

           {

            return(price+80*Point);  //S_MR¹pî]Ǐ'YÿS_MR„vVS÷N'YŽN„˜¾‹„v$N*Nbk_c<Pÿ£1\ôv¥cÎNS_MRVS÷Nprice R
NY\¹p\O:N°e„vbk_c<P

           }

   return(price+200*Point);

  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double HoldingOrderbuyAvgPrice()//YUSs^GW÷N

  {

   double Tmp=0;

   double TotalLots=0;

   for(int i=OrdersTotal()-1; i>=0; i--)

























     {

      bool os=OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true;







      if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)

        {

         Tmp+=OrderOpenPrice()*OrderLots();

         TotalLots+=OrderLots();

        }

     }

   if(TotalLots==0)

      return(0);

   else

      return(Tmp/TotalLots);

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double HoldingOrdersellAvgPrice()//zzUSs^GW÷N

  {

   double Tmp=0;

   double TotalLots=0;

   for(int i=OrdersTotal()-1; i>=0; i--)

     {

      bool os=OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true;







      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)

        {

         Tmp+=OrderOpenPrice()*OrderLots();

         TotalLots+=OrderLots();

        }

     }

   if(TotalLots==0)

      return(0);

   else

      return(Tmp/TotalLots);

  }











































/* fanxiangsuodan

êSý€(WêS	gUST¢‹USÅ`µQNO(uÿ‚Yœg	gYzzUSÿïSý€OۏeQ{kª_¯sNôvNUSÿR°‹ÿÿÿ

‚Yœg
NNaۏeQ{kª_¯sNôv_USÿ÷‹ËzsSsQí•MT4
Nb—„v ꁨR¤Nf 	c®”ÿ

ŸStÿ

	cöeô•’c^ÿÎNgée„vNUS_ËYO!k$R­e¢‹US{|‹Wÿ6qT_ÍST„vTKbpe¢‹USÿôv0RYzzKbpeøvI{ÿ

1uŽNêS/f€{US„vÎNgée„vNUS_ËYù[¢‹USۏLˆ$R­ev^Ytÿ‚Yœg	gYzzUSöeÿ$\vQ/fÏkUS
NTKbpe„v

YzzUSÿ bYzz;`KbpeNôv
NøvI{€ÛeQ{kª_¯sNôvNUSÿg}Y„vO(u¹eÕl/f(WUST¢‹US„vÅ`µQN

O(uÿg}YO(uß~N„vNUSKbpeÿُ7hïSåN=\ϑMQۏeQ{kª_¯sÿ€NïSåN㉳QèRTöe	gYzzUS„v˜ÿ

Ôk‚Y`ON†Nˆ_Y YUSÿLˆÅ`
Nù[ÿKb¨R•†NàQUSKNTÿÈSó`(uُ*N,ghQ•ÿ1uŽNgéeN„vý/fYUSÿ

@båN,gЏLˆKNTNôv(W_zzUSÿKNMR`OKb¨R•„vzzUS»y°s(Wgяÿ,gЏLˆ
N0R`ONzzUS„vMOn1\àV:N

Yzz;`KbpeøvI{€úQ†N0

*/

void fanxiangsuodan() //N.•ybϑ_ÍSTUS•ÓNêS	gTTUSöeO(u

  {

   for(int cnt=0; cnt<OrdersTotal(); cnt++)

     {

      if(buyLots()==sellLots())

        {

         Alert(Symbol(),"  ò]Ï~YŽN•ÓN¶r` ");

         return;

        }







      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

        {

         double lots=OrderLots();

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)

           {

            int b1=OrderSend(Symbol(),OP_SELL,lots,Bid,5,0,0,NULL,0,0,CLR_NONE);

            if(b1>0)

              {

               PlaySound("ok.wav");

               if(buyLots()==sellLots())

                 {

                  Alert(Symbol(),"  buyUS•ÓNbŸR ");

                  return;

                 }

              }

           }

         else

           {

            if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)

              {

               int s1=OrderSend(Symbol(),OP_BUY,lots,Ask,5,0,0,NULL,0,0,CLR_NONE);

               if(s1>0)

                 {

                  PlaySound("ok.wav");

                  if(buyLots()==sellLots())

                    {

                     Alert(Symbol(),"  sellUS•ÓNbŸR ");

                     return;

                    }

                 }

              }

           }

        }

     }

  }







//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double buyLots()

  {

   double buylots=0;

   for(int  i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol())

            if(OrderType()==OP_BUY)

              {

               buylots+=OrderLots();

              }

     }

   return(buylots);

  }







//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double sellLots()

  {

   double selllots=0;

   for(int  i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol())

            if(OrderType()==OP_SELL)

              {

               selllots+=OrderLots();

              }

     }

   return(selllots);

  }







//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zhinengguadanbuylimit()//zfý€buylimitUS

  {

   if(expirationM==0)

      expiration=0;

   double guadansl=0,guadantp=0;

   double ask;

   ask=Low[iLowest(NULL,zhinengtimeframe,MODE_LOW,zhinenga,zhinengb)]+press();

   if(Ask<ask+zhinengguadanjuxianjia*Point)

      ask=Ask-zhinengguadanjuxianjia*Point;

   if(zhinengguadanzengjiabuy!=0)

      ask+=zhinengguadanzengjiabuy*Point;

   for(int i=zhinengguadangeshu; i>0; i--)

























     {

      if(zhinengguadanSL!=0)

         guadansl=ask-zhinengguadanSL*Point;

      if(zhinengguadanTP!=0)

         guadantp=ask+zhinengguadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_BUYLIMIT,zhinengguadanlots,ask,zhinengguadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);







      if(ticket>0)

        {

         PlaySound("ok.wav");

         ask-=zhinengguadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zhinengguadanbuystop()//zfý€buystopUS

  {

   if(expirationM==0)

      expiration=0;

   double guadansl=0,guadantp=0;

   double ask;

   ask=High[iHighest(NULL,zhinengtimeframe,MODE_HIGH,zhinenga,zhinengb)]+press();

   if(Ask>ask-zhinengguadanjuxianjia*Point)

      ask=Ask+zhinengguadanjuxianjia*Point;

   if(zhinengguadanzengjiabuystop!=0)

      ask+=zhinengguadanzengjiabuystop*Point;

   for(int i=zhinengguadangeshu; i>0; i--)

























     {

      if(zhinengguadanSL!=0)

         guadansl=ask-zhinengguadanSL*Point;

      if(zhinengguadanTP!=0)

         guadantp=ask+zhinengguadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_BUYSTOP,zhinengguadanlots,ask,zhinengguadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);







      if(ticket>0)

        {

         PlaySound("ok.wav");

         ask+=zhinengguadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }



//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zhinengguadanselllimit()//zfý€selllimitUS

  {

   if(expirationM==0)

      expiration=0;

   double guadansl=0,guadantp=0;

   double bid;

   bid=High[iHighest(NULL,zhinengtimeframe,MODE_HIGH,zhinenga,zhinengb)]+press();

   if(Bid>bid-zhinengguadanjuxianjia*Point)

      bid=Bid+zhinengguadanjuxianjia*Point;

   if(zhinengguadanzengjiasell!=0)

      bid-=zhinengguadanzengjiasell*Point;

   for(int i=zhinengguadangeshu; i>0; i--)





     {

      if(zhinengguadanSL!=0)

         guadansl=bid+zhinengguadanSL*Point;

      if(zhinengguadanTP!=0)

         guadantp=bid-zhinengguadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_SELLLIMIT,zhinengguadanlots,bid,zhinengguadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);







      if(ticket>0)

        {

         PlaySound("ok.wav");

         bid+=zhinengguadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }





//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void zhinengguadansellstop()//zfý€sellstopUS

  {

   if(expirationM==0)

      expiration=0;

   double guadansl=0,guadantp=0;

   double bid;

   bid=Low[iLowest(NULL,zhinengtimeframe,MODE_LOW,zhinenga,zhinengb)]+press();

   if(Bid<bid+zhinengguadanjuxianjia*Point)

      bid=Bid-zhinengguadanjuxianjia*Point;

   if(zhinengguadanzengjiasellstop!=0)

      bid-=zhinengguadanzengjiasellstop*Point;

   for(int i=zhinengguadangeshu; i>0; i--)







     {

      if(zhinengguadanSL!=0)

         guadansl=bid+zhinengguadanSL*Point;

      if(zhinengguadanTP!=0)

         guadantp=bid-zhinengguadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_SELLSTOP,zhinengguadanlots,bid,zhinengguadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);







      if(ticket>0)

        {

         PlaySound("ok.wav");

         bid-=zhinengguadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }







/* 4Nöe_(u

void guadanbuylimit()//ÔYpNUS

  {

   if(expirationM==0) expiration=0;

   double guadansl=0,guadantp=0;

   double ask,bid;

   bid=Bid+guadanjuxianjia*Point;//ݍ»y°s÷N„v¹ppe

   ask=Ask-guadanjuxianjia*Point;

   for(int i=guadangeshu;i>0;i--)







     {

      if(guadanSL!=0) guadansl=ask-guadanSL*Point;

      if(guadanTP!=0) guadantp=ask+guadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_BUYLIMIT,guadanlots,ask,guadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);

      if(ticket>0)

        {

         PlaySound("ok.wav");

         ask-=guadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }

void guadanselllimit()//ÔYVSUS

  {

   if(expirationM==0) expiration=0;

   double guadansl=0,guadantp=0;

   double ask,bid;

   bid=Bid+guadanjuxianjia*Point;//ݍ»y°s÷N„v¹ppe

   ask=Ask-guadanjuxianjia*Point;

   for(int i=guadangeshu;i>0;i--)

     {

      if(guadanSL!=0) guadansl=bid+guadanSL*Point;

      if(guadanTP!=0) guadantp=bid-guadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_SELLLIMIT,guadanlots,bid,guadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);

      if(ticket>0)

        {

         PlaySound("ok.wav");

         bid+=guadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }

void guadanbuystop()//z4xýpNUS

  {

   if(expirationM==0) expiration=0;

   double guadansl=0,guadantp=0;

   double ask,bid;

   bid=Bid+guadanjuxianjia*Point;//ݍ»y°s÷N„v¹ppe

   ask=Ask+guadanjuxianjia*Point;

   for(int i=guadangeshu;i>0;i--)

     {

      if(guadanSL!=0) guadansl=ask-guadanSL*Point;

      if(guadanTP!=0) guadantp=ask+guadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_BUYSTOP,guadanlots,ask,guadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);

      if(ticket>0)

        {

         PlaySound("ok.wav");

         ask+=guadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }

void guadansellstop()//z4xýVSUS

  {

   if(expirationM==0) expiration=0;

   double guadansl=0,guadantp=0;

   double ask,bid;

   bid=Bid-guadanjuxianjia*Point;//ݍ»y°s÷N„v¹ppe

   ask=Ask-guadanjuxianjia*Point;

   for(int i=guadangeshu;i>0;i--)

     {

      if(guadanSL!=0) guadansl=bid+guadanSL*Point;

      if(guadanTP!=0) guadantp=bid-guadanTP*Point;

      int ticket=OrderSend(Symbol(),OP_SELLSTOP,guadanlots,bid,guadanslippage,guadansl,guadantp,NULL,0,expiration,CLR_NONE);

      if(ticket>0)

        {

         PlaySound("ok.wav");

         bid-=guadanjianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

  }

  */

void pingguadan()//ybϑs^cUS

  {

//---

   int tick[1000]= {-1};

   int pingFlag=0,slipPage=3;

   int j=0,i;

   for(i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         j++;

         tick[j]=OrderTicket();

         // Print("hQès^ÓNÿ",tick[j]);

        }

      else

        {

         Print("¢‹US	éb1Y%ÿ",GetLastError());

        }

     }







   if(j!=0) //‚Yœg	gcÓN

     {

      for(i=1; i<=j; i++)

        {

         int ticket=tick[i];

         if(OrderSelect(ticket,SELECT_BY_TICKET)==true)

           {

            int cmd=OrderType();

            /*

                        if(OrderSymbol()==Symbol() && cmd==OP_BUY) //$Rš[¢‹US/f&T/fS_MRþVhˆFUÁTŒT¢‹US{|‹Wÿ‚Yœg—‰@b	g¢‹USs^ÓNÿ÷‹»S‰c  OrderSymbol() == Symbol() && ÿNb—{|T0

                         {

                          if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),slipPage)==false)

                            {pingFlag=1;Print("Y4Ys^ÓN1Y%:",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                     if(OrderSymbol()==Symbol() && cmd==OP_SELL)

                         {

                          if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),slipPage)==false)

                             {pingFlag=1;Print("zz4Ys^ÓN1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

             */

            if(OrderSymbol()==Symbol() && cmd==OP_BUYLIMIT)

              {

               if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                 {pingFlag=1; Print("Y4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

              }

            else

               if(OrderSymbol()==Symbol() && cmd==OP_SELLLIMIT)

                 {

                  if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                    {pingFlag=1; Print("zz4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                 }

               else

                  if(OrderSymbol()==Symbol() && cmd==OP_BUYSTOP)

                    {

                     if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                       {pingFlag=1; Print("Y4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                    }

                  else

                     if(OrderSymbol()==Symbol() && cmd==OP_SELLSTOP)

                       {

                        if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                          {pingFlag=1; Print("zz4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                       }

           }

         else

           {Print("	éb¢‹US1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

        }

     }

   if(pingFlag==0)

     {Print("s^cUSbŸR"); PlaySound("ok.wav");}

   else

     {Print("s^ÓN1Y%ÿQegN!k"); PlaySound("timeout.wav");}

  }



//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void yijianpingcang()//N.•s^ÓN

  {

   int tick[200]= {-1};

   int pingFlag=0,slipPage=5;

   int j=0,i;

   for(i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         j++;

         tick[j]=OrderTicket();

         // Print("hQès^ÓNÿ",tick[j]);

        }

      else

        {

         Print("¢‹US	éb1Y%ÿ",GetLastError());

        }

     }

   if(j!=0) //‚Yœg	gcÓN

     {

      for(i=1; i<=j; i++)

        {

         int ticket=tick[i];

         if(OrderSelect(ticket,SELECT_BY_TICKET)==true)

           {

            int cmd=OrderType();



            if(OrderSymbol()==Symbol() && cmd==OP_BUY) //$Rš[¢‹US/f&T/fS_MRþVhˆFUÁTŒT¢‹US{|‹Wÿ‚Yœg—‰@b	g¢‹USs^ÓNÿ÷‹»S‰c  OrderSymbol() == Symbol() && ÿNb—{|T0

              {

               if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),slipPage)==false)

                 {pingFlag=1; Print("Y4Ys^ÓN1Y%:",GetLastError()," ¢‹US÷Sÿ",ticket);}

              }

            if(OrderSymbol()==Symbol() && cmd==OP_SELL)

              {

               if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),slipPage)==false)

                 {pingFlag=1; Print("zz4Ys^ÓN1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

              }

            /*

                        if(OrderSymbol()==Symbol() && cmd==OP_BUYLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_BUYSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

            */

           }

         else

           {Print("	éb¢‹US1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

        }

     }

   if(pingFlag==0)

     {Print("s^USbŸR"); PlaySound("ok.wav");}

   else

     {Alert("s^ÓN1Y%ÿQegN!k"); PlaySound("timeout.wav");}



  }







//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void yijianpingcangMagic(int Magic)//N.•s^ÓN

  {

   int tick[200]= {-1};

   int pingFlag=0,slipPage=5;

   int j=0,i;

   for(i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         j++;

         tick[j]=OrderTicket();

         // Print("hQès^ÓNÿ",tick[j]);

        }

      else

        {

         Print("¢‹US	éb1Y%ÿ",GetLastError());

        }

     }

   if(j!=0) //‚Yœg	gcÓN

     {

      for(i=1; i<=j; i++)

        {

         int ticket=tick[i];

         if(OrderSelect(ticket,SELECT_BY_TICKET)==true)

           {

            int cmd=OrderType();



            if(OrderSymbol()==Symbol() && cmd==OP_BUY && OrderMagicNumber()==Magic) //$Rš[¢‹US/f&T/fS_MRþVhˆFUÁTŒT¢‹US{|‹Wÿ‚Yœg—‰@b	g¢‹USs^ÓNÿ÷‹»S‰c  OrderSymbol() == Symbol() && ÿNb—{|T0

              {

               if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),slipPage)==false)

                 {pingFlag=1; Print("Y4Ys^ÓN1Y%:",GetLastError()," ¢‹US÷Sÿ",ticket);}

              }

            if(OrderSymbol()==Symbol() && cmd==OP_SELL && OrderMagicNumber()==Magic)

              {

               if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),slipPage)==false)

                 {pingFlag=1; Print("zz4Ys^ÓN1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

              }

            /*

                        if(OrderSymbol()==Symbol() && cmd==OP_BUYLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_BUYSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

            */

           }

         else

           {Print("	éb¢‹US1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

        }

     }

   if(pingFlag==0)

     {Print("s^USbŸR"); PlaySound("ok.wav");}

   else

     {Print("s^ÓN1Y%ÿQegN!k"); PlaySound("timeout.wav");}



  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void yijianpingbuydan()

  {

   int tick[200]= {-1};

   int pingFlag=0,slipPage=3;

   int j=0,i;

   for(i=0; i<OrdersTotal(); i++)





     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         j++;

         tick[j]=OrderTicket();

         // Print("hQès^ÓNÿ",tick[j]);

        }

      else

        {

         Print("¢‹US	éb1Y%ÿ",GetLastError());

        }

     }







   if(j!=0) //‚Yœg	gcÓN

     {

      for(i=1; i<=j; i++)







        {

         int ticket=tick[i];

         if(OrderSelect(ticket,SELECT_BY_TICKET)==true)

           {

            int cmd=OrderType();



            if(OrderSymbol()==Symbol() && cmd==OP_BUY) //$Rš[¢‹US/f&T/fS_MRþVhˆFUÁTŒT¢‹US{|‹Wÿ‚Yœg—‰@b	g¢‹USs^ÓNÿ÷‹»S‰c  OrderSymbol() == Symbol() && ÿNb—{|T0

              {

               if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),slipPage)==false)

                 {pingFlag=1; Print("Y4Ys^ÓN1Y%:",GetLastError()," ¢‹US÷Sÿ",ticket);}

              }

            /*            if(OrderSymbol()==Symbol() && cmd==OP_SELL)

                          {

                           if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),slipPage)==false)

                             {pingFlag=1;Print("zz4Ys^ÓN1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }



                        if(OrderSymbol()==Symbol() && cmd==OP_BUYLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_BUYSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

            */

           }

         else

           {Print("	éb¢‹US1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

        }

     }

   if(pingFlag==0)

     {Print("s^USbŸR"); PlaySound("ok.wav");}

   else

     {Alert("s^ÓN1Y%ÿQegN!k"); PlaySound("timeout.wav");}



  }











































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void yijianpingselldan()

  {

   int tick[200]= {-1};

   int pingFlag=0,slipPage=3;

   int j=0,i;

   for(i=0; i<OrdersTotal(); i++)





     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         j++;

         tick[j]=OrderTicket();

         // Print("hQès^ÓNÿ",tick[j]);

        }

      else

        {

         Print("¢‹US	éb1Y%ÿ",GetLastError());

        }

     }







   if(j!=0) //‚Yœg	gcÓN

     {

      for(i=1; i<=j; i++)







        {

         int ticket=tick[i];

         if(OrderSelect(ticket,SELECT_BY_TICKET)==true)

           {

            int cmd=OrderType();

            /*

                        if(OrderSymbol()==Symbol() && cmd==OP_BUY) //$Rš[¢‹US/f&T/fS_MRþVhˆFUÁTŒT¢‹US{|‹Wÿ‚Yœg—‰@b	g¢‹USs^ÓNÿ÷‹»S‰c  OrderSymbol() == Symbol() && ÿNb—{|T0

                          {

                           if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),slipPage)==false)

                             {pingFlag=1;Print("Y4Ys^ÓN1Y%:",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }*/

            if(OrderSymbol()==Symbol() && cmd==OP_SELL)

              {

               if(OrderClose(ticket,OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),slipPage)==false)

                 {pingFlag=1; Print("zz4Ys^ÓN1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

              }

            /*

                        if(OrderSymbol()==Symbol() && cmd==OP_BUYLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLLIMIT)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YLimitcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_BUYSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("Y4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

                        else if(OrderSymbol()==Symbol() && cmd==OP_SELLSTOP)

                          {

                           if(OrderDelete(OrderTicket(),CLR_NONE)==false)

                             {pingFlag=1;Print("zz4YStopcUS¤d•1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

                          }

            */

           }

         else

           {Print("	éb¢‹US1Y%ÿ",GetLastError()," ¢‹US÷Sÿ",ticket);}

        }

     }

   if(pingFlag==0)

     {Print("s^USbŸR"); PlaySound("ok.wav");}

   else

     {Alert("s^ÓN1Y%ÿQegN!k"); PlaySound("timeout.wav");}



  }

















































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void suocang()//N.••ÓN

  {

   if(CGetbuyLots()==CGetsellLots())

     {

      Alert(Symbol()," ò]Ï~YŽN•ÓN¶r` b zzÓN");

      return;

     }

   else

     {

      if(CGetbuyLots()>CGetsellLots())

         CLockOrder(OP_SELL);//If buy order lots>sell lots,send sell order to lock.‚YœgYUS'YŽNzzUSÿ_zzUS•ÓN

      if(CGetbuyLots()<CGetsellLots())

         CLockOrder(OP_BUY);//If buy order lots<sell lots,send buy order to lock.‚YœgYUS\ŽNzzUSÿ_YUS•ÓN

     }

  }

//+----------------------------•ÓNz^(Lock Order)-------------------+

void CLockOrder(int m_Ordertype)

  {



   if(m_Ordertype==OP_BUY)

     {

      //if(OrderSend(Symbol(),OP_BUY,CGetsellLots()-CGetbuyLots(),Ask,5,0,0,NULL,0,0))

      int keybuy=OrderSend(Symbol(),OP_BUY,CGetsellLots()-CGetbuyLots(),Ask,5,0,0,NULL,0,0);

      if(keybuy>0)

        {

         PlaySound("ok.wav");

         Alert(Symbol()," •ÓNbŸR");

        }

      else

        {

         PlaySound("timeout.wav");

         Print("Error=",GetLastError());

        }

     }



   if(m_Ordertype==OP_SELL)//rrr

     {

      // if(OrderSend(Symbol(),OP_SELL,CGetbuyLots()-CGetsellLots(),Bid,5,0,0,NULL,0,0))

      int keysell=OrderSend(Symbol(),OP_SELL,CGetbuyLots()-CGetsellLots(),Bid,5,0,0,NULL,0,0);

      if(keysell>0)

        {

         PlaySound("ok.wav");

         Alert(Symbol()," •ÓNbŸR");

        }

      else

        {

         PlaySound("timeout.wav");

         Print("GetLastError=",GetLastError());

        }

     }

// return(0);

  }



//+--------------¡‹—{buyNUSϑCalculate Buy Order Lots----------------+

double CGetbuyLots()

  {

   double m_buylots=0;

   for(int  i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol())

            if(OrderType()==OP_BUY)

              {

               m_buylots+=OrderLots();

              }

     }

   return(m_buylots);

  }

//+--------------------------------------------------------------------+

//+--------------¡‹—{sellNUSϑCalculate Sell Order Lots---------------+

double CGetsellLots()

  {

   double m_selllots=0;

   for(int  i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol())

            if(OrderType()==OP_SELL)

              {

               m_selllots+=OrderLots();

              }

     }



   return(m_selllots);

  }

//+--------------------------------------------------------------------+

int GetHoldingbuyOrdersCount()//¡‹—{YUS*Npe

  {

   int buyCount=0;

   for(int i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)

           {

            buyCount+=1;

           }

     }

   return(buyCount);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int GetHoldingsellOrdersCount()//¡‹—{zzUS*Npe

  {

   int sellCount=0;

   for(int i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)

           {

            sellCount+=1;

           }

     }

   return(sellCount);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int GetHoldingguadanOrdersCount()//¡‹—{cUS*Npe

  {

   int geshu=0;

   for(int i=0; i<OrdersTotal(); i++)



     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUYLIMIT)

           {

            geshu+=1;

           }







      if(OrderSymbol()==Symbol() && OrderType()==OP_BUYSTOP)

        {

         geshu+=1;

        }







      if(OrderSymbol()==Symbol() && OrderType()==OP_SELLLIMIT)

        {

         geshu+=1;

        }







      if(OrderSymbol()==Symbol() && OrderType()==OP_SELLSTOP)

        {

         geshu+=1;

        }

     }

   return(geshu);

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int GetHoldingguadanbuylimitOrdersCount()//¡‹—{cUSbuylimit*Npe

  {

   int geshu=0;

   for(int i=0; i<OrdersTotal(); i++)











































     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUYLIMIT)

           {

            geshu+=1;

           }

     }

   return(geshu);

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int GetHoldingguadanbuystopOrdersCount()//¡‹—{cUSbuystop*Npe

  {

   int geshu=0;

   for(int i=0; i<OrdersTotal(); i++)











































     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUYSTOP)

           {

            geshu+=1;

           }

     }

   return(geshu);

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int GetHoldingguadanselllimitOrdersCount()//¡‹—{cUSselllimit*Npe

  {

   int geshu=0;

   for(int i=0; i<OrdersTotal(); i++)











































     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_SELLLIMIT)

           {

            geshu+=1;

           }

     }

   return(geshu);

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

int GetHoldingguadansellstopOrdersCount()//¡‹—{cUSsellstop*Npe

  {

   int geshu=0;

   for(int i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_SELLSTOP)

           {

            geshu+=1;

           }

     }

   return(geshu);

  }





































/*

void zhinengsl()//ybϑzfý€¾‹nbk_c

  {

   double bid=0,ask=0;







   if(SL==0.0)

     {

      bid=zhinenggetbuySL(Bid);

      ask=zhinenggetsellSL(Ask);

     }







   else

     {

      if(SL<Bid)

        {

         bid=SL;

         ask=zhinenggetsellSL(Ask);

        }

      else

        {

         ask=SL;

         bid=zhinenggetbuySL(Bid);

        }

     }

   for(int  i=0;i<OrdersTotal();i++)







     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && onlybuy)

           {

            bool a1=OrderModify(OrderTicket(),OrderOpenPrice(),bid+press(),OrderTakeProfit(),0);

            bid-=c*Point;

           }

      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && onlysell)

        {

         bool a1=OrderModify(OrderTicket(),OrderOpenPrice(),ask+press(),OrderTakeProfit(),0);

         ask+=c*Point;

        }

     }

   PlaySound("ok.wav");

  }







double zhinenggetbuySL(double price)

  {

   double ATRSL;

   double LowSL;

   ATRSL=price-(e+d)*Point;

   LowSL=Low[iLowest(NULL,timeframe,MODE_LOW,a,b)];

   if((ATRSL<LowSL) && (ATRSL<=price)) {return(ATRSL);}

   else if((ATRSL>LowSL) &&(LowSL<=price)) {return(LowSL-(Ask-Bid)-d*Point);}

   else if((price<ATRSL) && (price<LowSL)) {return(price-e*10*Point);}

   return(price-300*Point);

  }







double zhinenggetsellSL(double price)

  {

   double ATRSL;

   double HighSL;

   ATRSL=price+(e+d)*Point;

   HighSL=High[iHighest(NULL,timeframe,MODE_HIGH,a,b)];

   if((ATRSL>HighSL) && (ATRSL>=price)) {return(ATRSL);}

   else if((ATRSL<HighSL) && (HighSL>=price)) {return(HighSL+(Ask-Bid)+d*Point);}

   else if((price>ATRSL) && (price>HighSL)) {return(price+e*10*Point);}

   return(price+300*Point);

  }







void zhinengtp()//ybϑzfý€¾‹nbkÈv

  {

   double bid=0,ask=0;







   if(TP==0.0)

     {

      bid=zhinenggetbuyTP(Ask);

      ask=zhinenggetsellTP(Bid);

     }

   else

     {

      if(TP>Bid)

        {

         ask=TP;

         bid=zhinenggetbuyTP(Ask);

        }

      else

        {

         bid=TP;

         ask=zhinenggetsellTP(Bid);

        }

     }

   for(int  i=0;i<OrdersTotal();i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && onlybuy)

           {

            bool a1=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),ask+press(),0);

            ask+=c*Point;

           }

      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && onlysell)

        {

         bool a1=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),bid+press(),0);

         bid-=c*Point;

        }

     }

   PlaySound("ok.wav");

  }







double zhinenggetbuyTP(double price)

  {

   double ATRSL;

   double LowSL;

   ATRSL=price-(e+d)*Point;

   LowSL=Low[iLowest(NULL,timeframe,MODE_LOW,a,b)];

   if((ATRSL<LowSL) && (ATRSL<=price)) {return(ATRSL);}

   else if((ATRSL>LowSL) &&(LowSL<=price)) {return(LowSL+(Ask-Bid)-d*Point);}

   else if((price<ATRSL) && (price<LowSL)) {return(price-e*10*Point);}

   return(price-300*Point);

  }







double zhinenggetsellTP(double price)

  {

   double ATRSL;

   double HighSL;

   ATRSL=price+(e+d)*Point;

   HighSL=High[iHighest(NULL,timeframe,MODE_HIGH,a,b)];

   if((ATRSL>HighSL) && (ATRSL>=price)) {return(ATRSL);}

   else if((ATRSL<HighSL) && (HighSL>=price)) {return(HighSL-(Ask-Bid)+d*Point);}

   else if((price>ATRSL) && (price>HighSL)) {return(price+e*10*Point);}

   return(price+300*Point);

  }



//| ,g,gÂS€†N ybϑ¾‹nbkÈvbk_c„v,g.mq4 a"ŒŸS\O€ boolapi

//|   xyz  2016.07.09 xyz0217@live.cn



*/

void piliangsltp()//ybϑîO9ebkÈvbk_c¹ppebôv¥c“eQ÷NMO„v,g

  {

   int iTp=TargetProfit,iSl=StopLoss;

   bool bOrderModify;

   double dTargetProfit,cStopLoss;

   if(Digits==3 || Digits==5)

     {

      iTp*=10;

      iSl*=10;

     }



   for(int i=OrdersTotal(); i>=0; i--)

     {

      if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))

         continue;







      if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && onlybuy)

        {

         if(StopLoss==0 && TargetProfit==0 && FixedStopLoss==0.0 && FixedTargetProfit==0.0)

           {

            dTargetProfit=0;

            cStopLoss=0;

           }

         else

           {

            if(FixedTargetProfit!=0.0)

               dTargetProfit=FixedTargetProfit;

            else

              {

               if(iTp==0)

                  dTargetProfit=OrderTakeProfit();

               else

                  dTargetProfit=OrderOpenPrice()+Point*iTp;

              }

            if(FixedStopLoss!=0.0)

               cStopLoss=FixedStopLoss;

            else

              {

               if(iSl==0)

                  cStopLoss=OrderStopLoss();

               else

                  cStopLoss=OrderOpenPrice()-Point*iSl;

              }

           }

         bOrderModify=OrderModify(OrderTicket(),

                                  OrderOpenPrice(),

                                  cStopLoss,

                                  dTargetProfit,

                                  0);

         if(GetLastError()==4109)

           {

            MessageBox("÷‹(W\"å]wQ\"->\"	y˜\"->\"EA¤Nf\"̑þR	\"/T(uEA¤Nfû|ß~\"","¾‹nbkÈvbk_c",0);

            return;

           }

        }







      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && onlysell)

        {

         if(StopLoss==0 && TargetProfit==0 && FixedStopLoss==0.0 && FixedTargetProfit==0.0)

           {

            dTargetProfit=0;

            cStopLoss=0;

           }

         else

           {

            if(FixedTargetProfit!=0.0)

               dTargetProfit=FixedTargetProfit;

            else

              {

               if(iTp==0)

                  dTargetProfit=OrderTakeProfit();

               else

                  dTargetProfit=OrderOpenPrice()-Point*iTp;

              }

            if(FixedStopLoss!=0.0)

               cStopLoss=FixedStopLoss;

            else

              {

               if(iSl==0)

                  cStopLoss=OrderStopLoss();

               else

                  cStopLoss=OrderOpenPrice()+Point*iSl;

              }

           }

         bOrderModify=OrderModify(OrderTicket(),

                                  OrderOpenPrice(),

                                  cStopLoss,

                                  dTargetProfit,

                                  0);

         if(!bOrderModify)

            if(GetLastError()==4109)

              {

               MessageBox("÷‹(W\"å]wQ\"->\"	y˜\"->\"EA¤Nf\"̑þR	\"/T(uEA¤Nfû|ß~\"","¾‹nbkÈvbk_c",0);

               return;

              }

        }

     }

   PlaySound("ok.wav");

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void piliangTPdianshu(int dianshu)//

  {

   if(bkey)

     {

      Print("YUSybϑûy¨RbkÈv0RGW÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("YUSybϑûy¨RbkÈv0RGW÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   if(skey)

     {

      Print("zzUSybϑûy¨RbkÈv0RGW÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("zzUSybϑûy¨RbkÈv0RGW÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   double baobenbuyTP=NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)+dianshu*Point;

   double baobensellTP=NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)-dianshu*Point;

   for(int  i=0; i<OrdersTotal(); i++)

























     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && bkey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),baobenbuyTP,0);

            baobenbuyTP+=piliangtpjianju*Point;

           }

         if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && skey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),baobensellTP,0);

            baobensellTP-=piliangtpjianju*Point;

           }

        }

     }

   PlaySound("ok.wav");

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void piliangSLdianshu(int dianshu)

  {

   if(bkey)

     {

      Print("YUSybϑûy¨Rbk_c0RGW÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("YUSybϑûy¨Rbk_c0RGW÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   if(skey)

     {

      Print("zzUSybϑûy¨Rbk_c0RGW÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("zzUSybϑûy¨Rbk_c0RGW÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   double baobenbuySL=NormalizeDouble(HoldingOrderbuyAvgPrice(),Digits)-dianshu*Point;

   double baobensellSL=NormalizeDouble(HoldingOrdersellAvgPrice(),Digits)+dianshu*Point;

   for(int  i=0; i<OrdersTotal(); i++)

























     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && bkey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),baobenbuySL,OrderTakeProfit(),0);

            baobenbuySL-=piliangsljianju*Point;

           }

         if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && skey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),baobensellSL,OrderTakeProfit(),0);

            baobensellSL+=piliangsljianju*Point;

           }

        }

     }

   PlaySound("ok.wav");

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void piliangTPnowdianshu(int dianshu)

  {

   if(bkey)

     {

      Print("YUSybϑûy¨RbkÈv0R°s÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("YUSybϑûy¨RbkÈv0R°s÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   if(skey)

     {

      Print("zzUSybϑûy¨RbkÈv0R°s÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("zzUSybϑûy¨RbkÈv0R°s÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   double bid=Bid+dianshu*Point;

   double ask=Ask-dianshu*Point;

   for(int  i=0; i<OrdersTotal(); i++)

























     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && bkey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),bid,0);

            bid+=piliangtpjianju*Point;

           }

         if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && skey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),ask,0);

            ask-=piliangtpjianju*Point;

           }

        }

     }

   PlaySound("ok.wav");

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void piliangSLnowdianshu(int dianshu)

  {

   if(bkey)

     {

      Print("YUSybϑûy¨Rbk_c0R°s÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("YUSybϑûy¨Rbk_c0R°s÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   if(skey)

     {

      Print("zzUSybϑûy¨Rbk_c0R°s÷N„v",dianshu,"*NúW¹p
N Yt-N . . .");

      comment(StringFormat("zzUSybϑûy¨Rbk_c0R°s÷N„v%G*NúW¹p
N Yt-N . . .",dianshu));

     }

   double bid=Bid-dianshu*Point;

   double ask=Ask+dianshu*Point;

   for(int  i=0; i<OrdersTotal(); i++)

     {

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && bkey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),bid,OrderTakeProfit(),0);

            bid-=piliangtpjianju*Point;

           }

         if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && skey)

           {

            bool om=OrderModify(OrderTicket(),OrderOpenPrice(),ask,OrderTakeProfit(),0);

            ask+=piliangtpjianju*Point;

           }

        }

     }

   PlaySound("ok.wav");

  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void comment(string str)//¢‹USáOo`>f:y(WþVhˆ

  {

   if(dingdanxianshi)

     {

      ObjectCreate(0,"zi",OBJ_LABEL,0,0,0);

      ObjectSetInteger(0,"zi",OBJPROP_CORNER,CORNER_RIGHT_UPPER);

      ObjectSetInteger(0,"zi",OBJPROP_XDISTANCE,dingdanxianshiX1);

      ObjectSetInteger(0,"zi",OBJPROP_YDISTANCE,dingdanxianshiY1);

      ObjectSetText("zi",str,16,"ўSO",dingdanxianshicolor);

     }

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void comment1(string str)//¢‹USáOo`>f:y(WþVhˆoR,g

  {

   if(dingdanxianshi)

     {

      ObjectCreate(0,"zi1",OBJ_LABEL,0,0,0);

      ObjectSetInteger(0,"zi1",OBJPROP_CORNER,CORNER_RIGHT_UPPER);

      ObjectSetInteger(0,"zi1",OBJPROP_XDISTANCE,dingdanxianshiX2);

      ObjectSetInteger(0,"zi1",OBJPROP_YDISTANCE,dingdanxianshiY2);

      ObjectSetText("zi1",str,16,"ўSO",dingdanxianshicolor);

     }

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void movesttp()//ûy¨RS_MR÷N„vbkÈvbk_c

  {

   for(int cnt=0; cnt<OrdersTotal(); cnt++) //ûy¨RbkÈvbk_c

     {

      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)

        {

         if(OrderSymbol()==Symbol())

           {

            double stp=OrderStopLoss();

            double tpt=OrderTakeProfit();

            double OpenPrice=OrderOpenPrice();



            if(OriginalLot==0)

              {

               OriginalLot=OrderLots();

              }

            if(OrderType()==OP_BUY && onlybuy1)

              {

               if(stp==0 && tpt==0)

                  return;

               else

                 {

                  if(stp!=0 && onlystp)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),stp-moveSTTP*Point,OrderTakeProfit(),0,CLR_NONE);

                    }

                  if(stp!=0 && onlyup)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),stp+moveSTTP*Point,OrderTakeProfit(),0,CLR_NONE);

                    }



                  if(tpt!=0 && onlytpt)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),tpt+Point*moveSTTP,0,CLR_NONE);

                    }

                  if(tpt!=0 && onlydown)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),tpt-Point*moveSTTP,0,CLR_NONE);

                    }

                 }

              }

            if(OrderType()==OP_SELL && onlysell1)

              {

               if(stp==0 && tpt==0)

                  return;

               else

                 {

                  if(stp!=0 && onlystp)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),stp+moveSTTP*Point,OrderTakeProfit(),0,CLR_NONE);

                    }

                  if(stp!=0 && onlydown)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),stp-moveSTTP*Point,OrderTakeProfit(),0,CLR_NONE);

                    }



                  if(tpt!=0 && onlytpt)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),tpt-Point*moveSTTP,0,CLR_NONE);

                    }

                  if(tpt!=0 && onlyup)

                    {

                     bool om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),tpt+Point*moveSTTP,0,CLR_NONE);

                    }

                 }

              }

           }

        }







      else

        {

         OriginalLot=0;

        }

     }

   PlaySound("ok.wav");

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double GetiLowest(int Timeframe,int bars,int beginbar)

  {

   double LowSL=Low[iLowest(NULL,Timeframe,MODE_LOW,bars,beginbar)];

   return LowSL;

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double GetiHighest(int Timeframe,int bars,int beginbar)

  {

   double HighSL=High[iHighest(NULL,Timeframe,MODE_HIGH,bars,beginbar)];

   return HighSL;

  }

void PiliangSL(bool buytrue,double price,int jianju,int pianyiliang,int juxianjia,int dingdangeshu)//buytrue ‚Yœg/fbuyUS1\/ftrue sellUS1\/ffalse //pianyiliang ckpe/fckTOPûy pe/fÍSTOPûy



  {

   int jishu=0;

   bool om;

   double bid=0,ask=0;

//if(juxianjiadingshi03==false)

//  {

   if(buytrue && price+juxianjia*Point>Ask)

      price=Ask-juxianjia*Point;

   if(buytrue==false && price-juxianjia*Point<Bid)

      price=Bid+juxianjia*Point;

//   }

   ask=price-pianyiliang*Point;

   bid=price+pianyiliang*Point;

   for(int i=OrdersTotal()-1; i>=0; i--)



     {

      if(jishu>=dingdangeshu)

         break;







      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && buytrue)

           {

            om=OrderModify(OrderTicket(),OrderOpenPrice(),ask,OrderTakeProfit(),0);

            ask-=jianju*Point;

            jishu+=1;

           }







      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && buytrue==false)

        {

         om=OrderModify(OrderTicket(),OrderOpenPrice(),bid,OrderTakeProfit(),0);

         bid+=jianju*Point;

         jishu+=1;

        }

     }

   if(om)

      PlaySound("ok.wav");

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void PiliangTP(bool buytrue,double price,int jianju,int pianyiliang,int juxianjia,int dingdangeshu)//buytrue ‚Yœg/fbuyUS1\/ftrue sellUS1\/ffalse

  {

   int jishu=0;

   bool om;

   double bid=0,ask=0;

//if(juxianjiadingshi03==false)

//  {

   if(buytrue && price-juxianjia*Point<Bid)

      price=Bid+juxianjia*Point;

   if(buytrue==false && price+juxianjia*Point>Ask)

      price=Ask-juxianjia*Point;

//   }

   ask=price-pianyiliang*Point;

   bid=price+pianyiliang*Point;

   for(int i=OrdersTotal()-1; i>=0; i--)































     {

      if(jishu>=dingdangeshu)

         break;







      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && buytrue)

           {

            om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),ask,0);

            ask+=jianju*Point;

            jishu+=1;

           }







      if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && buytrue==false)

        {

         om=OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),bid,0);

         bid-=jianju*Point;

         jishu+=1;

        }

     }

   if(om)

      PlaySound("ok.wav");

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Guadanbuylimit(double lots,double price,int geshu,int jianju,double sl,double tp,int juxianjia)//ÔYpNUS

  {

   double guadansl=0.0,guadantp=0.0;

   double sl1=sl,tp1=tp;

   if(Ask-juxianjia*Point<price)

      price=Ask-juxianjia*Point;

   for(int i=geshu; i>0; i--)

     {

      if(sl==MathRound(sl))

        {

         if(sl==0.0)

           {

            guadansl=0;

           }

         else

           {

            guadansl=price-sl*Point;

           }

        }

      else

        {

         guadansl=sl1;

        }







      if(tp==MathRound(tp))

        {

         if(tp==0.0)

           {

            guadantp=0;

           }

         else

           {

            guadantp=price+tp*Point;

           }

        }

      else

        {

         guadantp=tp1;

        }

      // if(sl!=0) guadansl=price-sl*Point;

      // if(tp!=0) guadantp=price+tp*Point;

      int ticket=OrderSend(Symbol(),OP_BUYLIMIT,lots,price,slippage,guadansl,guadantp,NULL,0,0,CLR_NONE);







      if(ticket>0)

        {

         price-=jianju*Point;

         sl1-=jianju*Point;

         tp1-=jianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

   PlaySound("ok.wav");

  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Guadanselllimit(double lots,double price,int geshu,int jianju,double sl,double tp,int juxianjia)//ÔYVSUS

  {

   double guadansl=0,guadantp=0;

   double sl1=sl,tp1=tp;

   if(Bid+juxianjia*Point>price)

      price=Bid+juxianjia*Point;

   for(int i=geshu; i>0; i--)

     {

      if(sl==MathRound(sl))

        {

         if(sl==0.0)

           {

            guadansl=0;

           }

         else

           {

            guadansl=price+sl*Point;

           }

        }

      else

        {

         guadansl=sl1;

        }

      if(tp==MathRound(tp))

        {

         if(tp==0.0)

           {

            guadantp=0;

           }

         else

           {

            guadantp=price-tp*Point;

           }

        }

      else

        {

         guadantp=tp1;

        }

      //if(sl!=0) guadansl=price+sl*Point;

      //if(tp!=0) guadantp=price-tp*Point;

      int ticket=OrderSend(Symbol(),OP_SELLLIMIT,lots,price,slippage,guadansl,guadantp,NULL,0,0,CLR_NONE);







      if(ticket>0)

        {

         price+=jianju*Point;

         sl1+=jianju*Point;

         tp1+=jianju*Point;

        }

      else

        {

         PlaySound("timeout.wav");

        }

     }

   PlaySound("ok.wav");

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Guadanbuystop(double lots,double price,int geshu,int jianju,double sl,double tp,int juxianjia)//z4xýpNUS

  {

   double guadansl=0,guadantp=0;

   if(Ask+juxianjia*Point>price)

      price=Ask+juxianjia*Point;

   for(int i=geshu; i>0; i--)

























     {

      if(sl!=0)

         guadansl=price-sl*Point;

      if(tp!=0)

         guadantp=price+tp*Point;

      int ticket=OrderSend(Symbol(),OP_BUYSTOP,lots,price,slippage,guadansl,guadantp,NULL,0,0,CLR_NONE);







      if(ticket>0)

        {

         price+=jianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

   PlaySound("ok.wav");

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Guadansellstop(double lots,double price,int geshu,int jianju,double sl,double tp,int juxianjia)//z4xýVSUS

  {

   double guadansl=0,guadantp=0;

   if(Bid-juxianjia*Point<price)

      price=Bid-juxianjia*Point;

   for(int i=geshu; i>0; i--)

     {

      if(sl!=0)

         guadansl=price+sl*Point;

      if(tp!=0)

         guadantp=price-tp*Point;

      int ticket=OrderSend(Symbol(),OP_SELLSTOP,lots,price,slippage,guadansl,guadantp,NULL,0,0,CLR_NONE);

      if(ticket>0)

        {

         price-=jianju*Point;

        }

      else

         PlaySound("timeout.wav");

     }

   PlaySound("ok.wav");

  }













//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Fibguadan(int guadantype,double lowprice,double highprice)//guadantype=0 buylimit guadantype=1 selllimit eâl£QYcUS

  {

   int sl=fibGuadansl;

   int geshu=fibGuadangeshu;

   double fib[7]= {-0.236,0,0.236,0.382,0.5,0.618,0.764};













   if(guadantype==0)

     {



      for(int i=6; i>=0; i--)







        {

         if(i==fibhulue6 || i==fibhulue5 || i==fibhulue4 || i==fibhulue3 || i==fibhulue2 || i==fibhulue1 || i==fibhulue0)

            continue;

         double price=NormalizeDouble(lowprice+(highprice-lowprice)*fib[i]-fibbuypianyiliang*Point,Digits);

         Print("i=",i," ~vRÔkMO",fib[i]*100,"%"," cUS*Npe=",geshu,"  cUS÷NMO=",price);

         if(price>Ask)

            continue;

         if(i==0 && fibGuadansl1!=0)

            sl=fibGuadansl1;

         //Print(fibGuadansl);

         Guadanbuylimit(fibGuadanlots,price,geshu,fibGuadanjianju,sl,fibGuadantp,fibGuadanjuxianjia);

         geshu++;

        }

     }













   if(guadantype==1)

     {

      for(int i=6; i>=0; i--)







        {

         if(i==fibhulue6 || i==fibhulue5 || i==fibhulue4 || i==fibhulue3 || i==fibhulue2 || i==fibhulue1 || i==fibhulue0)

            continue;

         double price=NormalizeDouble(highprice-(highprice-lowprice)*fib[i]+fibsellpianyiliang*Point,Digits);

         Print("i=",i," ~vRÔkMO",fib[i]*100,"%"," cUS*Npe=",geshu,"  cUS÷NMO=",price);

         if(price<Bid)

            continue;

         if(i==0 && fibGuadansl1!=0)

            sl=fibGuadansl1;

         Guadanselllimit(fibGuadanlots,price,geshu,fibGuadanjianju,sl,fibGuadantp,fibGuadanjuxianjia);

         geshu++;

        }

     }



  }





































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Tenguadan(bool buyorsell,int weishu,double max)//tepeMOýUS

  {

   if(max>MarketInfo(Symbol(),MODE_SPREAD))

      max=MarketInfo(Symbol(),MODE_SPREAD);

   double bid=StrToDouble(StringSubstr(DoubleToString(Bid,Digits),0,weishu));







   if(buyorsell)

     {

      double price=bid+(max+tenbuypianyiliang)*Point+press();

      Print("°s÷N ",Bid," ý_eu>\peTz^¡‹—{Ó~œg",bid," zfý€¡‹—{Tbuylimit_ËYcUS÷NMO",price," ÝOi–ªc½e ‚Yœg¹pî]Ǐ'YO(uÂSpe„vúVš[<P S_MR¹pî]",MarketInfo(Symbol(),MODE_SPREAD));

      //if(price+stoplevel*Point>Ask) Print("cUS»y°s÷NǏя (W\Pbk4ls^MOcUS"); price=Ask-(stoplevel+3)*Point;



      Guadanbuylimit(tenGuadanlots,price,tenGuadangeshu,tenGuadanjianju,tenGuadansl,tenGuadantp,tenGuadanjuxianjia);

     }







   else

     {

      int digits=1000;

      int geshu=StringLen(DoubleToString(Bid,Digits));

      int huluegeshu=geshu-weishu;

      if(huluegeshu==0)

         digits=1;

      if(huluegeshu==1)

         digits=10;

      if(huluegeshu==2)

         digits=100;

      if(huluegeshu==3)

         digits=1000;

      if(huluegeshu==4)

         digits=10000;

      if(huluegeshu==5)

         digits=100000;

      if(huluegeshu==6)

         digits=1000000;

      Print("cselllimitUS¡‹—{tepeMO—‰ R„v¹ppe",digits);

      double price=bid+digits*Point-tensellpianyiliang*Point+press();

      Print("°s÷N ",Bid,"ý_eu>\peTz^¡‹—{Ó~œg",bid," zfý€¡‹—{TselllimitcUS÷NMO ",price," ÝOi–ªc½e ‚Yœg¹pî]Ǐ'YO(uÂSpe„vúVš[<P S_MR¹pî]",MarketInfo(Symbol(),MODE_SPREAD));

      //if(Bid+stoplevel*Point>price) Print("cUS»y°s÷NǏя (W\Pbk4ls^MOcUS"); price=Bid+(stoplevel+3)*Point;

      Guadanselllimit(tenGuadanlots,price,tenGuadangeshu,tenGuadanjianju,tenGuadansl,tenGuadantp,tenGuadanjuxianjia);

     }

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Tensltp(bool buyorsell,bool SLtrue,int weishu,double max)//tepeMOýUS

  {

   if(max>MarketInfo(Symbol(),MODE_SPREAD))

      max=MarketInfo(Symbol(),MODE_SPREAD);

   double bid=StrToDouble(StringSubstr(DoubleToString(Bid,Digits),0,weishu));







   if(buyorsell && SLtrue)

     {

      double price=bid-max*Point+press();

      Print("°s÷N ",Bid," ý_eu>\peTz^¡‹—{Ó~œg",bid," zfý€¡‹—{TbuyUSSL÷NMO",price," ÝOi–ªc½e ‚Yœg¹pî]Ǐ'YO(uÂSpe„vúVš[<P S_MR¹pî]",MarketInfo(Symbol(),MODE_SPREAD));

      //if(price+stoplevel*Point>Ask) Print("cUS»y°s÷NǏя (W\Pbk4ls^MOcUS"); price=Ask-(stoplevel+3)*Point;

      PiliangSL(true,price,tensltpjianju,tensltppianyiliang,tensltpjuxianjia,tensltpdingdangeshu);

     }







   if(!buyorsell && !SLtrue)

     {

      double price=bid+max*Point+press();

      Print("°s÷N ",Bid," ý_eu>\peTz^¡‹—{Ó~œg",bid," zfý€¡‹—{TsellUSTP÷NMO",price," ÝOi–ªc½e ‚Yœg¹pî]Ǐ'YO(uÂSpe„vúVš[<P S_MR¹pî]",MarketInfo(Symbol(),MODE_SPREAD));

      PiliangTP(false,price,tensltpjianju,tentppianyiliang,tensltpjuxianjia,tensltpdingdangeshu);

     }







   if(buyorsell && !SLtrue)

     {

      int digits=1000;

      int geshu=StringLen(DoubleToString(Bid,Digits));

      int huluegeshu=geshu-weishu;

      if(huluegeshu==0)

         digits=1;

      if(huluegeshu==1)

         digits=10;

      if(huluegeshu==2)

         digits=100;

      if(huluegeshu==3)

         digits=1000;

      if(huluegeshu==4)

         digits=10000;

      if(huluegeshu==5)

         digits=100000;

      if(huluegeshu==6)

         digits=1000000;

      Print("¡‹—{tepeMO—‰ R„v¹ppe",digits);

      double price=bid+digits*Point+press();

      Print("°s÷N ",Bid,"ý_eu>\peTz^¡‹—{Ó~œg",bid," zfý€¡‹—{TbuyUSTP÷NMO ",price," ÝOi–ªc½e ‚Yœg¹pî]Ǐ'YO(uÂSpe„vúVš[<P S_MR¹pî]",MarketInfo(Symbol(),MODE_SPREAD));

      //if(Bid+stoplevel*Point>price) Print("cUS»y°s÷NǏя (W\Pbk4ls^MOcUS"); price=Bid+(stoplevel+3)*Point;

      PiliangTP(true,price,tensltpjianju,tentppianyiliang,tensltpjuxianjia,tensltpdingdangeshu);



     }







   if(!buyorsell && SLtrue)

     {

      int digits=1000;

      int geshu=StringLen(DoubleToString(Bid,Digits));

      int huluegeshu=geshu-weishu;

      if(huluegeshu==0)

         digits=1;

      if(huluegeshu==1)

         digits=10;

      if(huluegeshu==2)

         digits=100;

      if(huluegeshu==3)

         digits=1000;

      if(huluegeshu==4)

         digits=10000;

      if(huluegeshu==5)

         digits=100000;

      if(huluegeshu==6)

         digits=1000000;

      Print("¡‹—{tepeMO—‰ R„v¹ppe",digits);

      double price=bid+digits*Point+MarketInfo(Symbol(),MODE_SPREAD)*Point+press();

      Print("°s÷N ",Bid,"ý_eu>\peTz^¡‹—{Ó~œg",bid," zfý€¡‹—{TsellUSSL÷NMO ",price," ÝOi–ªc½e ‚Yœg¹pî]Ǐ'YO(uÂSpe„vúVš[<P S_MR¹pî]",MarketInfo(Symbol(),MODE_SPREAD));

      PiliangSL(false,price,tensltpjianju,tensltppianyiliang,tensltpjuxianjia,tensltpdingdangeshu);

     }



  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void buysellnowSL(bool buyorsell,double lots,int Timeframe,int bars,int beginbars,double pianyiliang)//&^bk_cNUS

  {

   if(buyorsell)

     {

      Print("^÷Nbuy ",lots,"Kb &^bk_c ÖS",bars,"9hK¿~¡‹—{ Yt-N . . .");

      comment(StringFormat("^÷Nbuy %GKb &^bk_c ÖS%G9hK¿~¡‹—{ Yt-N . . .",lots,bars));



      if(testtradeSLSP)///f&T/ecôv¥c&^bk_cNUS

        {

         double buysl=GetiLowest(Timeframe,bars,beginbars)-(MarketInfo(Symbol(),MODE_SPREAD)+pianyiliang)*Point;//rrr

         int buySLticket=OrderSend(Symbol(),OP_BUY,lots,Ask,keyslippage,buysl,0,NULL,0,0);

         if(buySLticket>0)

           {

            PlaySound("ok.wav");

           }

         else

           {

            PlaySound("timeout.wav");

            Print("GetLastError=",GetLastError());

            falsetimeCurrent=TimeCurrent();

           }

        }

      else

        {

         int buySLticket1=OrderSend(Symbol(),OP_BUY,lots,Ask,keyslippage,0,0,NULL,0,0);

         if(buySLticket1>0)

           {

            PlaySound("ok.wav");

            if(OrderSelect(buySLticket1,SELECT_BY_TICKET,MODE_TRADES)==true)

              {

               double buysl1=GetiLowest(Timeframe,bars,beginbars)-(MarketInfo(Symbol(),MODE_SPREAD)+pianyiliang)*Point;

               bool keybuy1=OrderModify(OrderTicket(),OrderOpenPrice(),buysl1,0,0);

              }

           }

         else

           {

            PlaySound("timeout.wav");

            Print("GetLastError=",GetLastError());

            falsetimeCurrent=TimeCurrent();

           }

        }

     }



   else

     {

      Print("^÷Nsell ",lots,"Kb &^bk_c ÖS",bars,"9hK¿~¡‹—{ Yt-N . . .");

      comment(StringFormat("^÷Nsell %GKb &^bk_c ÖS%G9hK¿~¡‹—{ Yt-N . . .",lots,bars));

      if(testtradeSLSP)

        {

         double sl=GetiHighest(Timeframe,bars,beginbars)+(MarketInfo(Symbol(),MODE_SPREAD)*2+pianyiliang)*Point;

         int sellSLticket=OrderSend(Symbol(),OP_SELL,lots,Bid,keyslippage,sl,0,NULL,0,0);

         if(sellSLticket>0)

            PlaySound("ok.wav");

         else

           {

            PlaySound("timeout.wav");

            Print("GetLastError=",GetLastError());

            falsetimeCurrent=TimeCurrent();

           }

        }







      else

        {

         int sellSLticket=OrderSend(Symbol(),OP_SELL,lots,Bid,keyslippage,0,0,NULL,0,0);

         if(sellSLticket>0)

           {

            PlaySound("ok.wav");

            if(OrderSelect(sellSLticket,SELECT_BY_TICKET,MODE_TRADES)==true)

              {

               double sl=GetiHighest(Timeframe,bars,beginbars)+(MarketInfo(Symbol(),MODE_SPREAD)*2+pianyiliang)*Point;

               bool keysell=OrderModify(OrderTicket(),OrderOpenPrice(),sl,0,0);

              }

           }

         else

           {

            PlaySound("timeout.wav");

            Print("GetLastError=",GetLastError());

            falsetimeCurrent=TimeCurrent();

           }

        }

     }

  }



//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

string swaptype()//ǏY“^X[9¡‹—{¹eÕl

  {

   int Num=(int)MarketInfo(Symbol(),MODE_SWAPTYPE);







   switch(Num)

     {

      case 0:

         return(" ”–Y“^X[9¡‹—{¹eÕl - ¹ppe¡‹—{");

      case 1:

         return(" ”–Y“^X[9¡‹—{¹eÕl - ¤NfÁTÍyúW@x'^¡‹—{");

      case 2:

         return(" ”–Y“^X[9¡‹—{¹eÕl - Ç)Ro`");

      case 3:

         return(" ”–Y“^X[9¡‹—{¹eÕl - ¹ppe¡‹—{");

      default:

         return(" ”–Y“^X[9¡‹—{¹eÕl Unknown");

     }

  }













//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// === ·ƒÖS¢‹USID ===

void GetOrdersID()

  {

   int i,n,t,o;

   bool all;

   n=OrdersTotal();

   ArrayResize(OrdersID,n);

   all=StringFind(¡{tcÓNUS÷S,"*")>=0;

   OpType= -1;

   for(i = 0,OrdersCount = 0; i<n; i++)

     {

      bool aa=OrderSelect(i,SELECT_BY_POS);







      if(Symbol()==OrderSymbol())

        {

         t=OrderTicket();

         if(all || (StringFind(¡{tcÓNUS÷S,DoubleToStr(t,0))>=0))

           {

            o=OrderType();

            if(o<2)

              {

               if((OpType>=0) && (o!=OpType))

                 {

                  OpType=-1;

                  break;

                 }

               else

                 {

                  OpType=o;

                  OrdersID[OrdersCount]=t;

                  OrdersCount++;

                 }

              }

           }

        }

     }







   if(OrdersCount==0)

     {

      ObjectDelete(TPObjName);

      ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      //------------

      ú^ÓN÷N=0;

      ûy¨Rbk_c=0;



     }

  }

// === û[~b·ƒ)Rbk_c¿~ ===

void SearchObjName(int Type,bool GetTPObj=true,bool GetSLObj=true)

  {

   int    i,ObjType,iAbove,iBelow,iTP,iSL;

   double MinAbove,MaxBelow,y1,y2;

   string ObjName;



   MinAbove = 999999;

   MaxBelow = 0;

   iAbove   = -1;

   iBelow   = -1;

   for(i=0; i<ObjectsTotal(); i++)

     {

      ObjName = ObjectName(i);

      ObjType = ObjectType(ObjName);

      switch(ObjType)

        {

         case OBJ_TREND :

         case OBJ_TRENDBYANGLE :

            y1 = CalcLineValue(ObjName, 0, 1, ObjType);

            y2 = y1;

            break;

         case OBJ_CHANNEL :

            y1 = CalcLineValue(ObjName, 0, MODE_UPPER, ObjType);

            y2 = CalcLineValue(ObjName, 0, MODE_LOWER, ObjType);

            break;

         default :

            y1 = -1;

            y2 = -1;

        }







      if((y1>0) && (y1<Bid) && (y1>MaxBelow)) // $Nag¿~ý(WS_MR÷NN¹e

        {

         MaxBelow = y1;

         iBelow   = i;

        }







      else

         if((y2>Bid) && (y2<MinAbove)) // $Nag¿~ý(WS_MR÷N
N¹e

           {

            MinAbove = y2;

            iAbove   = i;

           }







         else                // $Nag¿~N
NNN

           {

            if((y1>0) && (y1<MinAbove))

              {

               MinAbove = y1;

               iAbove   = i;

              }

            if(y2>MaxBelow)

              {

               MaxBelow = y2;

               iBelow   = i;

              }

           }

     }







   switch(Type)

     {

      case OP_BUY :

         iTP = iAbove;

         iSL = iBelow;

         break;

      case OP_SELL :

         iTP = iBelow;

         iSL = iAbove;

         break;

      default :

         iTP = -1;

         iSL = -1;

     }







   if(GetTPObj)

     {

      if(iTP>=0)

         TPObjName=ObjectName(iTP);

     }







   if(GetSLObj)

     {

      if(iSL>=0)

         SLObjName=ObjectName(iSL);

     }

  }







// === ¡‹—{·ƒ)R÷NŒTbk_c÷N ===

void CalcPrice(double &TPPrice,double &SLPrice)

  {



//6Rš[¹e_RËYSš[IN0000êñ] RagöNîO9e                       //  |

   double BL1,BL2;                                              //  |

   BL1=NormalizeDouble(iCustom(NULL,0,"Bands",bandsA,bandsB,bandsC,1,0),Digits);                       //  |

   BL2=NormalizeDouble(iCustom(NULL,0,"Bands",bandsA,bandsB,bandsC,2,0),Digits);

   Print(BL1," ",BL2);

// ·ƒ)R÷N

   switch(·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN)

     {

      case 1 :



         //6Rš[1¹e_·ƒ)Rš[IN0000êñ] RagöNîO9eI{÷STb—„v               //  |

         if(OrderType()==OP_SELL)

            TPPrice=BL2+MarketInfo(Symbol(),MODE_SPREAD)*bandsdianchabeishu*Point+bandsTPpianyi*Point;

         if(OrderType()==OP_BUY)

            TPPrice=BL1-MarketInfo(Symbol(),MODE_SPREAD)*bandsdianchabeishu*Point-bandsTPpianyi*Point;                                        //  |



         break;

      case 2 :

         TPPrice=CalcLineValue(TPObjName,0,1+OpType);

         break;

      default :

         TPPrice=-1;

     }







// bk_c÷N

   switch(bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c)

     {

      case 1 :



         //6Rš[1¹e_bk_cš[IN0000êñ] RagöNîO9eI{÷STb—„v               //  |

         if(OrderType()==OP_SELL)

            SLPrice=BL1+MarketInfo(Symbol(),MODE_SPREAD)*bandsdianchabeishu*Point+bandsSLpianyi*Point;

         if(OrderType()==OP_BUY)

            SLPrice=BL2-MarketInfo(Symbol(),MODE_SPREAD)*bandsdianchabeishu*Point-bandsSLpianyi*Point;

         //  |



         break;

      case 2 :

         SLPrice=CalcLineValue(SLObjName,0,2-OpType);

         break;

      //-------------------

      case 3 :

         SLPrice=ûy¨Rbk_c;

         break;



      default :

         SLPrice=-1;

     }

  }













// === ¡‹—{ôv¿~(WÐg*Nk¿~„v<P ===

double CalcLineValue(string ObjName,int Shift,int ValueIndex=1,int ObjType=-1)

  {

   double y1,y2,delta,ret;

   int    i;



   if((ObjType<0) && (StringLen(ObjName)>0))

      ObjType=ObjectType(ObjName);







   switch(ObjType)

     {

      case OBJ_TREND :

      case OBJ_TRENDBYANGLE :

         ret=LineGetValueByShift(ObjName,Shift);

         break;

      case OBJ_CHANNEL :

         i=GetBarShift(Symbol(),0,ObjectGet(ObjName,OBJPROP_TIME3));

         delta=ObjectGet(ObjName,OBJPROP_PRICE3)-LineGetValueByShift(ObjName,i);

         y1 = LineGetValueByShift(ObjName, Shift);

         y2 = y1 + delta;

         if(ValueIndex==MODE_UPPER)

            ret=MathMax(y1,y2);

         else

            if(ValueIndex==MODE_LOWER)

               ret=MathMin(y1,y2);

            else

               ret=-1;

         break;

      default :

         ret=-1;

     }

   return(ret);

  }













// === >f:y·ƒ)Rbk_c÷N4ls^¿~ ===

void ShowTPSLLines(double TPPrice,double SLPrice)

  {

   if(TPPrice<0)

      ObjectDelete(TP_PRICE_LINE);







   else

     {

      if(FindObject(TP_PRICE_LINE)<0)

        {

         ObjectCreate(TP_PRICE_LINE,OBJ_HLINE,0,0,0);

         ObjectSet(TP_PRICE_LINE,OBJPROP_COLOR,·ƒ)R÷N<h:y‹O¿~);

         ObjectSet(TP_PRICE_LINE,OBJPROP_STYLE,STYLE_SOLID);

         ObjectSet(TP_PRICE_LINE,OBJPROP_WIDTH,1);

        }

      ObjectMove(TP_PRICE_LINE,0,Time[0],TPPrice);

     }



   if(SLPrice<0)

      ObjectDelete(SL_PRICE_LINE);







   else

     {

      if(FindObject(SL_PRICE_LINE)<0)

        {

         ObjectCreate(SL_PRICE_LINE,OBJ_HLINE,0,0,0);

         ObjectSet(SL_PRICE_LINE,OBJPROP_COLOR,bk_c÷N<h:y‹O¿~);

         ObjectSet(SL_PRICE_LINE,OBJPROP_STYLE,STYLE_SOLID);

         ObjectSet(SL_PRICE_LINE,OBJPROP_WIDTH,1);

        }

      ObjectMove(SL_PRICE_LINE,0,Time[0],SLPrice);

     }

  }













// === åg~bù[aŒ ===

int FindObject(string Name)

  {

   if(StringLen(Name)<=0)

      return(-1);

   else

      return(ObjectFind(Name));

  }













// === s^ÓN ===

void CloseOrder(int Ticket,int type)

  {

   double ClosePrice;

   string str[2]= {"TP","SL"};







   if(OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES))

     {

      if(OrderType()==OP_BUY)

         ClosePrice=MarketInfo(Symbol(),MODE_BID);

      else

         ClosePrice=MarketInfo(Symbol(),MODE_ASK);

      if(OrderClose(Ticket,OrderLots(),ClosePrice,0))

         Print("Order #",Ticket," was closed successfully at ",str[type]," ",ClosePrice);

      else

         Print("Order #",Ticket," reached ",str[type]," ",ClosePrice,", but failed to close for error ",GetLastError());

     }

  }





































// === ¡‹—{ôv¿~
N„v<P ===

double LineGetValueByShift(string ObjName,int Shift)

  {

   double i1,i2,i,y1,y2,y;

   i1 = GetBarShift(Symbol(), 0, ObjectGet(ObjName, OBJPROP_TIME1));

   i2 = GetBarShift(Symbol(), 0, ObjectGet(ObjName, OBJPROP_TIME2));

//Print("aaa=",ObjectGet(ObjName,OBJPROP_TIME3));

   y1 = ObjectGet(ObjName, OBJPROP_PRICE1);

   y2 = ObjectGet(ObjName, OBJPROP_PRICE2);







   if(i1<i2)

     {

      i  = i1;

      i1 = i2;

      i2 = i;

      y  = y1;

      y1 = y2;

      y2 = y;

     }

   if(Shift>i1)

      y=(y2-y1)/(i2-i1) *(Shift-i1)+y1;

   else

      y=ObjectGetValueByShift(ObjName,Shift);



   return(y);

  }





































// === ÖSöeô•<P„vshiftpe ===

int GetBarShift(string symbol,int atimeframe,double time)

  {

   datetime now;

   now=iTime(symbol,atimeframe,0);

   int now1=StrToInteger(IntegerToString(now,0));

   int time1=StrToInteger(DoubleToStr(time,0));

// Print("now2=",now2,"  ","now=",now,"time=",time,"time1=",time1);

   if(time1<now1+atimeframe*60)

      return(iBarShift(symbol, atimeframe, time1));







   else

     {

      if(atimeframe==0)

         atimeframe=Period();

      return((now1 - time1) / atimeframe / 60);

     }

  }

































//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

double press()//žX RbÏQ\OPûy

  {

   double pianyi=(shangpress-xiapress)*presspianyi*Point;

   shangpress=0;

   xiapress=0;

   return(pianyi);

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Huaxianguadan()//R¿~ cUS

  {

//Print("R¿~s^ÓN_ËY");

///////////////////////////////////////////////////////////////////

   double TPPrice,SLPrice,tpPrice,slPrice;

   ·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN=2;

   bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c=2;







   if(kkey && bkey)//ôv¥cR¿~¾‹nbkÈvbk_c YUSbk_c

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print("TPPrice=",tpPrice," ","SLPrice=",slPrice);

      if(SLPrice>0 && TPPrice<0)

         PiliangSL(true,slPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);







      //if(TPPrice>0 && SLPrice<0)PiliangSL(true,tpPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);

      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice<Bid)

            PiliangSL(true,tpPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);

         if(slPrice<Bid)

            PiliangSL(true,slPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      kkey=false;

      bkey=false;

     }







   if(kkey && skey)//ôv¥cR¿~¾‹nbkÈvbk_c zzUSbk_c

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print("TPPrice=",tpPrice," ","SLPrice=",slPrice);

      if(SLPrice>0 && TPPrice<0)

         PiliangSL(false,slPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);







      //if(TPPrice>0 && SLPrice<0)PiliangSL(false,tpPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);

      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice>Bid)

            PiliangSL(false,tpPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);

         if(slPrice>Bid)

            PiliangSL(false,slPrice,jianju07,pianyiliang07,juxianjia07,dingdangeshu07);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      kkey=false;

      skey=false;

     }







   if(okey && bkey)//ôv¥cR¿~¾‹nbkÈvbk_c YUSbkÈv

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print("TPPrice=",tpPrice," ","SLPrice=",slPrice);

      //if(SLPrice>0 && TPPrice<0)PiliangTP(true,slPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);

      if(TPPrice>0 && SLPrice<0)

         PiliangTP(true,tpPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);







      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice>Bid)

            PiliangTP(true,tpPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);

         if(slPrice>Bid)

            PiliangTP(true,slPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      okey=false;

      bkey=false;

     }







   if(okey && skey)//ôv¥cR¿~¾‹nbkÈvbk_c zzUSbkÈv

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print("TPPrice=",tpPrice," ","SLPrice=",slPrice);

      //if(SLPrice>0 && TPPrice<0)PiliangTP(false,slPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);

      if(TPPrice>0 && SLPrice<0)

         PiliangTP(false,tpPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);







      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice<Bid)

            PiliangTP(false,tpPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);

         if(slPrice<Bid)

            PiliangTP(false,slPrice,jianju07,pianyiliang07tp,juxianjia07,dingdangeshu07);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      okey=false;

      skey=false;

     }







   if(okey && lkey)//ôv¥cR¿~cUS

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print(tpPrice," ",slPrice);

      if(SLPrice>0 && TPPrice<0)

         Guadanbuylimit(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

      if(TPPrice>0 && SLPrice<0)

         Guadanbuylimit(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);







      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice<Bid)

            Guadanbuylimit(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

         if(slPrice<Bid)

            Guadanbuylimit(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      okey=false;

      lkey=false;

     }







   if(kkey && lkey)//

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print(tpPrice," ",slPrice);

      if(SLPrice>0 && TPPrice<0)

         Guadanselllimit(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

      if(TPPrice>0 && SLPrice<0)

         Guadanselllimit(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);







      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice>Bid)

            Guadanselllimit(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

         if(slPrice>Bid)

            Guadanselllimit(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      kkey=false;

      lkey=false;

     }







   if(pkey && lkey)//

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print(tpPrice," ",slPrice);

      if(SLPrice>0 && TPPrice<0)

         Guadanbuystop(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

      if(TPPrice>0 && SLPrice<0)

         Guadanbuystop(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);







      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice>Bid)

            Guadanbuystop(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

         if(slPrice>Bid)

            Guadanbuystop(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      pkey=false;

      lkey=false;

     }







   if(lkey && lkey)//

     {

      CalcPrice(TPPrice,SLPrice);

      tpPrice=NormalizeDouble(TPPrice,Digits);

      slPrice=NormalizeDouble(SLPrice,Digits);

      Print(tpPrice," ",slPrice);

      if(SLPrice>0 && TPPrice<0)

         Guadansellstop(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

      if(TPPrice>0 && SLPrice<0)

         Guadansellstop(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);







      if(TPPrice>0 && SLPrice>0)

        {

         if(tpPrice<Bid)

            Guadansellstop(huaxianguadanlots,tpPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

         if(slPrice<Bid)

            Guadansellstop(huaxianguadanlots,slPrice,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

        }

      if(ObjectFind(TPObjName)>=0)

         ObjectDelete(TPObjName);

      if(ObjectFind(SLObjName)>=0)

         ObjectDelete(SLObjName);

      if(ObjectFind(TP_PRICE_LINE)>=0)

         ObjectDelete(TP_PRICE_LINE);

      if(ObjectFind(SL_PRICE_LINE)>=0)

         ObjectDelete(SL_PRICE_LINE);

      huaxianguadan=false;

      Print("R¿~cUS!j_sQí•");

      comment1("R¿~cUS!j_sQí•");

      lkey=false;

     }

   bool   SetTPObj=false,SetSLObj=false;

//string MesgText;

   GetOrdersID();     // ·ƒÖS—‰¡{t„v¢‹USID







   if(OpType>=0) // ¹eTNô

     {

      if(·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN==2)

         SetTPObj=FindObject(TPObjName)<0;

      if(bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c==2)

         SetSLObj=FindObject(SLObjName)<0;

      if(SetTPObj || SetSLObj)

         SearchObjName(OpType,SetTPObj,SetSLObj);         // dû[·ƒ)Rbk_c¿~„vù[aŒ
T

      CalcPrice(TPPrice,SLPrice);

      if(/f&T>f:y:y‹O¿~)

         ShowTPSLLines(TPPrice,SLPrice);







      if((SLPrice>0) &&

         ((OpType==OP_BUY) && (Bid<=SLPrice)))

         //((OpType == OP_SELL) &&(Bid<= TPPrice))))

         //((OpType == OP_SELL) &&(Bid>= SLPrice))))

         //CloseOrder(OrdersID[i],1);

        {

         Guadanbuylimit(huaxianguadanlots,Ask-(stoplevel+5)*Point,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

         if(ObjectFind(TPObjName)>=0)

            ObjectDelete(TPObjName);

         if(ObjectFind(SLObjName)>=0)

            ObjectDelete(SLObjName);

         if(ObjectFind(TP_PRICE_LINE)>=0)

            ObjectDelete(TP_PRICE_LINE);

         if(ObjectFind(SL_PRICE_LINE)>=0)

            ObjectDelete(SL_PRICE_LINE);

         huaxianguadan=false;

         Print("R¿~cUS!j_sQí•");

         comment1("R¿~cUS!j_sQí•");

        }







      if((SLPrice>0) &&

         //(((OpType== OP_BUY) &&(Bid>= TPPrice))||

         ((OpType==OP_SELL) && (Bid>=SLPrice)))

         //((OpType == OP_SELL) &&(Bid<= TPPrice))))

         //CloseOrder(OrdersID[i],2);

        {

         Guadanselllimit(huaxianguadanlots,Bid+(stoplevel+5)*Point,huaxianguadangeshu,huaxianguadanjianju,huaxianguadansl,huaxianguadantp,huaxianguadanjuxianjia);

         if(ObjectFind(TPObjName)>=0)

            ObjectDelete(TPObjName);

         if(ObjectFind(SLObjName)>=0)

            ObjectDelete(SLObjName);

         if(ObjectFind(TP_PRICE_LINE)>=0)

            ObjectDelete(TP_PRICE_LINE);

         if(ObjectFind(SL_PRICE_LINE)>=0)

            ObjectDelete(SL_PRICE_LINE);

         huaxianguadan=false;

         Print("R¿~cUS!j_sQí•");

         comment1("R¿~cUS!j_sQí•");

        }

     }

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void Huaxiankaicang()//R¿~ôv¥c_ÓN

  {

   ·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN=2;

   bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c=2;

// Print("R¿~s^ÓN_ËY");

   double TPPrice,SLPrice;

   bool   SetTPObj=false,SetSLObj=false;

//string MesgText;

   GetOrdersID();     // ·ƒÖS—‰¡{t„v¢‹USID







   if(OpType>=0) // ¹eTNô

     {

      if(·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN==2)

         SetTPObj=FindObject(TPObjName)<0;

      if(bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c==2)

         SetSLObj=FindObject(SLObjName)<0;

      if(SetTPObj || SetSLObj)

         SearchObjName(OpType,SetTPObj,SetSLObj);         // dû[·ƒ)Rbk_c¿~„vù[aŒ
T

      CalcPrice(TPPrice,SLPrice);

      if(/f&T>f:y:y‹O¿~)

         ShowTPSLLines(TPPrice,SLPrice);







      if((SLPrice>0) &&

         ((OpType==OP_BUY) && (Bid<=SLPrice)))

         //((OpType == OP_SELL) &&(Bid<= TPPrice))))

         //((OpType == OP_SELL) &&(Bid>= SLPrice))))

         //CloseOrder(OrdersID[i],1);

        {

         for(int i=huaxiankaicanggeshu; i>0; i--)

           {

            int keybuy=OrderSend(Symbol(),OP_BUY,keylots,MarketInfo(Symbol(),MODE_ASK),keyslippage,0,0,NULL,0,0);

            Print(TimeCurrent());

            if(keybuy>0)

               PlaySound("ok.wav");

            else

               PlaySound("timeout.wav");

            Sleep(huaxiankaicangtime);

           }

         if(ObjectFind(TPObjName)>=0)

            ObjectDelete(TPObjName);

         if(ObjectFind(SLObjName)>=0)

            ObjectDelete(SLObjName);

         if(ObjectFind(TP_PRICE_LINE)>=0)

            ObjectDelete(TP_PRICE_LINE);

         if(ObjectFind(SL_PRICE_LINE)>=0)

            ObjectDelete(SL_PRICE_LINE);

         huaxiankaicang=false;

         Print("æ‰ÊSR¿~ôv¥c_ÓN!j_sQí•");

         comment1("æ‰ÊSR¿~ôv¥c_ÓN!j_sQí•");

        }







      if((SLPrice>0) &&

         //(((OpType== OP_BUY) &&(Bid>= TPPrice))||

         ((OpType==OP_SELL) && (Bid>=SLPrice)))

         //((OpType == OP_SELL) &&(Bid<= TPPrice))))

         //CloseOrder(OrdersID[i],2);

        {

         for(int i=huaxiankaicanggeshu; i>0; i--)

           {

            int keysell=OrderSend(Symbol(),OP_SELL,keylots,MarketInfo(Symbol(),MODE_BID),keyslippage,0,0,NULL,0,0);

            if(keysell>0)

               PlaySound("ok.wav");

            else

              {

               PlaySound("timeout.wav");

               Print("Error=",GetLastError());

              }

            Print(TimeCurrent());

            Sleep(huaxiankaicangtime);

           }

         if(ObjectFind(TPObjName)>=0)

            ObjectDelete(TPObjName);

         if(ObjectFind(SLObjName)>=0)

            ObjectDelete(SLObjName);

         if(ObjectFind(TP_PRICE_LINE)>=0)

            ObjectDelete(TP_PRICE_LINE);

         if(ObjectFind(SL_PRICE_LINE)>=0)

            ObjectDelete(SL_PRICE_LINE);

         huaxiankaicang=false;

         Print("æ‰ÊSR¿~ôv¥c_ÓN!j_sQí•");

         comment1("æ‰ÊSR¿~ôv¥c_ÓN!j_sQí•");

        }

     }

  }



















//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void HuaxianSwitch()////R¿~s^ÓNãNx R¿~•ÓN ^—g&^s^ÓN

  {

//Print("HuaxianSwitchЏLˆ");

   double TPPrice,SLPrice;

   bool   SetTPObj=false,SetSLObj=false;

//string MesgText;

   GetOrdersID();     // ·ƒÖS—‰¡{t„v¢‹USID







   if(OpType>=0) // ¹eTNô

     {

      if(·ƒ)R¹e_16Rš[2‹¿R¿~0àe·ƒ)Rs^ÓN==2)

         SetTPObj=FindObject(TPObjName)<0;

      if(bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c==2)

         SetSLObj=FindObject(SLObjName)<0;

      if(SetTPObj || SetSLObj)

         SearchObjName(OpType,SetTPObj,SetSLObj);         // dû[·ƒ)Rbk_c¿~„vù[aŒ
T







      //--------------

      if(bk_c¹e_16Rš[2‹¿R¿~3ûy¨Rbk_c0àebk_c==3)

        {

         ú^ÓN÷N=OrderOpenPrice();

         if(OrderType()==OP_BUY)

            //‚Yœg(¢‹US{|‹W=YUS)

           {

            if(ûy¨Rbk_c<ú^ÓN÷N-Point*bk_c)

               ûy¨Rbk_c=ú^ÓN÷N-Point*bk_c;

            if(Bid>ú^ÓN÷N+–™!kÝO¤bÈv)Rbk_c*Point && ûy¨Rbk_c<ú^ÓN÷N+ÝO¤bÈv)R*Point)

               ûy¨Rbk_c=ú^ÓN÷N+ÝO¤bÈv)R*Point;

            if(Bid>ú^ÓN÷N+ûy¨Rek•*1*Point && ûy¨Rbk_c<ú^ÓN÷N+ÝO¤bÈv)R*Point)

               ûy¨Rbk_c=ú^ÓN÷N+ÝO¤bÈv)R*Point;

            if(Bid>ú^ÓN÷N+ûy¨Rek•*2*Point && ûy¨Rbk_c<ú^ÓN÷N+ûy¨Rek•*1*Point)

               ûy¨Rbk_c=ú^ÓN÷N+ûy¨Rek•*1*Point;

            if(Bid>ú^ÓN÷N+ûy¨Rek•*3*Point && ûy¨Rbk_c<ú^ÓN÷N+ûy¨Rek•*2*Point)

               ûy¨Rbk_c=ú^ÓN÷N+ûy¨Rek•*2*Point;

            if(Bid>ú^ÓN÷N+ûy¨Rek•*5*Point && ûy¨Rbk_c<ú^ÓN÷N+ûy¨Rek•*3*Point)

               ûy¨Rbk_c=ú^ÓN÷N+ûy¨Rek•*3*Point;

            if(Bid>ú^ÓN÷N+ûy¨Rek•*7*Point && ûy¨Rbk_c<ú^ÓN÷N+ûy¨Rek•*4*Point)

               ûy¨Rbk_c=ú^ÓN÷N+ûy¨Rek•*4*Point;

           }



         if(OrderType()==OP_SELL)

            //‚Yœg ÓNUS{|‹W=zzUSÿRÿ

           {

            if(ûy¨Rbk_c<ú^ÓN÷N+Point*bk_c)

               ûy¨Rbk_c=ú^ÓN÷N+Point*bk_c;

            if(Ask<ú^ÓN÷N-–™!kÝO¤bÈv)Rbk_c*Point && ûy¨Rbk_c>ú^ÓN÷N-ÝO¤bÈv)R*Point-(Ask-Bid)*Point)

               ûy¨Rbk_c=ú^ÓN÷N-ÝO¤bÈv)R*Point-(Ask-Bid)*Point;

            if(Ask<ú^ÓN÷N-ûy¨Rek•*1*Point && ûy¨Rbk_c>ú^ÓN÷N-ÝO¤bÈv)R*Point-(Ask-Bid)*Point)

               ûy¨Rbk_c=ú^ÓN÷N-ÝO¤bÈv)R*Point-(Ask-Bid)*Point;

            if(Ask<ú^ÓN÷N-ûy¨Rek•*2*Point && ûy¨Rbk_c>ú^ÓN÷N-ûy¨Rek•*1*Point)

               ûy¨Rbk_c=ú^ÓN÷N-ûy¨Rek•*1*Point;

            if(Ask<ú^ÓN÷N-ûy¨Rek•*3*Point && ûy¨Rbk_c>ú^ÓN÷N-ûy¨Rek•*2*Point)

               ûy¨Rbk_c=ú^ÓN÷N-ûy¨Rek•*2*Point;

            if(Ask<ú^ÓN÷N-ûy¨Rek•*5*Point && ûy¨Rbk_c>ú^ÓN÷N-ûy¨Rek•*3*Point)

               ûy¨Rbk_c=ú^ÓN÷N-ûy¨Rek•*3*Point;

            if(Ask<ú^ÓN÷N-ûy¨Rek•*7*Point && ûy¨Rbk_c>ú^ÓN÷N-ûy¨Rek•*4*Point)

               ûy¨Rbk_c=ú^ÓN÷N-ûy¨Rek•*4*Point;

           }

        }

      //---------------

      CalcPrice(TPPrice,SLPrice);

      /*

               MesgText="bk_cÿ";

               if(SLPrice<0)

                  MesgText=MesgText+" __ ";

               else

                  MesgText=MesgText+DoubleToStr(SLPrice,Digits);

               MesgText=MesgText+"  ÿbkbÿ";

               if(TPPrice<0)

                  MesgText=MesgText+" __ ";

               else

                  MesgText=MesgText+DoubleToStr(TPPrice,Digits);

               Comment(MesgText);

      */

      if(/f&T>f:y:y‹O¿~)

         ShowTPSLLines(TPPrice,SLPrice);

      if((SLPrice>0) &&

         (((OpType== OP_BUY) &&(Bid<= SLPrice))||

          ((OpType == OP_SELL) &&(Bid>= SLPrice))))

         //CloseOrder(OrdersID[i],1);

        {

         if(huaxianShift)

           {

            suocang();

           }

         else

           {

            if(huaxianCtrl)

              {

               fanxiangsuodan();

              }

            else

              {

               xunhuanquanpingcang();

              }

           }



         if(ObjectFind(TPObjName)>=0)

            ObjectDelete(TPObjName);

         if(ObjectFind(SLObjName)>=0)

            ObjectDelete(SLObjName);

         if(ObjectFind(TP_PRICE_LINE)>=0)

            ObjectDelete(TP_PRICE_LINE);

         if(ObjectFind(SL_PRICE_LINE)>=0)

            ObjectDelete(SL_PRICE_LINE);

         huaxianSwitch=false;

         huaxianTimeSwitch=false;

         huaxianShift=false;

         huaxianCtrl=false;

         Print("æ‰ÊSR¿~ôv¥cs^ÓNbÍS•!j_sQí•");

         comment1("æ‰ÊSR¿~ôv¥cs^ÓNbÍS•!j_sQí•");

        }







      if((TPPrice>0) &&

         (((OpType== OP_BUY) &&(Bid>= TPPrice))||

          ((OpType == OP_SELL) &&(Bid<= TPPrice))))

         //CloseOrder(OrdersID[i],2);

        {

         if(huaxianShift)

           {

            suocang();

           }

         else

           {

            if(huaxianCtrl)

              {

               fanxiangsuodan();

              }

            else

              {

               xunhuanquanpingcang();

              }

           }

         if(ObjectFind(TPObjName)>=0)

            ObjectDelete(TPObjName);

         if(ObjectFind(SLObjName)>=0)

            ObjectDelete(SLObjName);

         if(ObjectFind(TP_PRICE_LINE)>=0)

            ObjectDelete(TP_PRICE_LINE);

         if(ObjectFind(SL_PRICE_LINE)>=0)

            ObjectDelete(SL_PRICE_LINE);

         huaxianSwitch=false;

         huaxianTimeSwitch=false;

         huaxianShift=false;

         huaxianCtrl=false;

         Print("æ‰ÊSR¿~ôv¥cs^ÓNbÍS•!j_sQí•");

         comment1("æ‰ÊSR¿~ôv¥cs^ÓNbÍS•!j_sQí•");

        }

     }

  }







//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void SetLevel(string text,double level,color col1)//RNag*j¿~

  {



   string linename=text;







   if(ObjectFind(linename)!=0)

     {

      ObjectCreate(linename,OBJ_HLINE,0,Time[linebar],level);

      ObjectSet(linename,OBJPROP_STYLE,STYLE_SOLID);

      ObjectSet(linename,OBJPROP_LEVELWIDTH,5);

      ObjectSet(linename,OBJPROP_COLOR,col1);

     }







   else

     {

      ObjectMove(linename,0,Time[linebar],level);

     }

  }









//+------------------------------------------------------------------+



//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---