《利用均线间隔距离来进行交易的系统方案》由会员分享,可在线阅读,更多相关《利用均线间隔距离来进行交易的系统方案(12页珍藏版)》请在金锄头文库上搜索。
1、利用均线间隔距离来进行交易的系统(据说价格300欧元)/ user in putexter n double Lots=0.1;/ how many lots to trade at a timeexter n int Slippage=2;/ how many pips of slippage can youtolorateextern int Fast_TimeFrame=0;exter n int Fast_Period=28;extern int Fast_Price = PRICE_OPEN;extern int Fast_Mode = MODE_SMA;exter n int Fa
2、st_Shift=0;exter n int Slow_TimeFrame=0;exter n int Slow_Period=73;exter n int Slow_Price = PRICE_OPEN;extern int Slow_Mode = MODE_SMA;extern int Slow_Shift=0;extern double DVBuySell=0.002;extern int MAXTrades=5; extern double ProfitMade=100; exter n double LossLimit=72;extern int TrailStop=999;exte
3、rn int PLBreakEve n=999; made (999=off)exter n int StartHour=0;exter n int StopHour=24;extern int BasketProfit=9999; tradesextern int BasketLoss=9999;/ nu mber of trades to have ope n at once/ how much money do you expect to make/ how much loss can you tolorate/ traili ng stop (999=no traili ng stop
4、)/ set break eve n whe n this many pips are/ your local time to start making trades/ your local time to stop making trades/ if equity reaches this level, close/ if equity reaches this n egative level, close trades / naming and nu mberi ngint MagicNumber = 200601182020; / allows multiple experts to t
5、rade on same acco unt/ Bar han dli ng datetime bartime=0; int bartick=0; int objtick=0; inttickco un t=0;stri ng TradeComme nt = 2MA_Diverge nceTrader_04_;/ used to determ ine whe n a bar has moved/ nu mber of times bars have moved/ used to draw objects on the chart / Trade controlbool TradeAllowed=
6、true; / Mi n/Max tracki ng double maxOrders;/ used to man age tradesdouble maxEquity;double min Equity;double CECou nt;double CEProc;double CEBuy;double CESell;/+| Custom in it |ll+/ Called ONCE whe n EA is added to chart or recompiled int init()int i;stri ng o;/remove the old objectsfor(i=0; iBars;
7、 i+)o=DoubleToStr(i,0);ObjectDelete(myx+o);ObjectDelete(myz+o);objtick=0;Print(Init happened ,CurTime();Comme nt(” );/+/ Custom DE-i nit /+/ Called ONCE whe n EA is removed from chartint dein it()int i;stri ng o;/remove the old objectsfor(i=0; i=O;c nt-)OrderSelect(c nt, SELECT_BY_POS, MODE_TRADES);
8、if( OrderSymbol()=Symbol() & OrderMagicNumber()=MagicNumber)OrdersPerSymbol+;if(OrderType()=OP_BUY) OrdersBUY+;if(OrderType()=OP_SELL)OrdersSELL+;if(OrdersPerSymbolmaxOrders) maxOrders=OrdersPerSymbol;/+| In sert your in dicator here | And set either BUYme or | SELLme true to place orders |/+diverge
9、=diverge nce(O);Comme nt(Curre nt Diverge nee = ”,diverge);if( diverge=DVBuySell ) BUYme=true;if( diverge=(DVBuySell*(-1) ) SELLme=true;/+| End Insert |/+/ENTRY LONG (buy, Ask)if(OrdersPerSymbol=MAXTrades & TradeAllowed & BUYme)/Ask(buy, lo ng)if(LossLimit =0) SL=0; else SL=Ask-(LossLimit+7)*Point()
10、;if(ProfitMade=0) TP=0; else TP=Ask+(ProfitMade+7)*Poi nt();OrderSe nd(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,TradeComme nt,MagicNumber,White);gle=GetLastError();if(gle=O)Print(BUY Ask=,Ask, bartick=,bartick);ObjectCreate(myx+DoubleToStr(objtick,0),OBJ_TEXT, 0, TimeO,High0+(5*p);ObjectSetText(myx+D
11、oubleToStr(objtick,0),B,15,Arial,Red);bartick=0;TradeAllowed=false;elsePrint(-ERROR-BUYAsk=,Ask,error=,gle,bartick=,bartick);/ENTRY SHORT (sell, Bid)if(OrdersPerSymbol=MAXTrades & TradeAllowed & SELLme )/Bid (sell, short)if(LossLimit =0) SL=0; else SL=Bid+(LossLimit+7)*Point(); if(ProfitMade=0) TP=0; else TP=Bid-(ProfitMade+7)*Poi nt();OrderSe nd(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,TradeComme nt,MagicNumber,Red);gle=GetLastError();if(gle=0)Print(SELL Bid=,Bid, bartick=,bartick);ObjectCreate(myx+DoubleToStr