If not clear anyone knock here
God is watching. He's watching you not doing the work yourself. Asking other people to automate your strategy. He's watching you asking for someone to put it all on a plate for you. He will also be watching if you spam people in private messages
Hello
Test this code and tell me if it meets your login requirements so that I can continue
extern int MA_slow = 50; extern int MA_fast = 21; int count= Bars; void OnTick() { if(count!=Bars) { if(Close[1]<iMA(NULL,0,MA_slow,0,MODE_SMA,PRICE_MEDIAN,0)&&Close[1]<iMA(NULL,0,MA_fast,0,MODE_SMA,PRICE_MEDIAN,0)) { if(Open[2]<Close[2]&&Close[1]<Open[2]) { OrderSend(Symbol(),OP_SELL,1,Bid,3,Bid+(100*Point),Bid-(300*Point),NULL,8585,0,clrRed); } } if(Close[1]>iMA(NULL,0,MA_slow,0,MODE_SMA,PRICE_MEDIAN,0)&&Close[1]>iMA(NULL,0,MA_fast,0,MODE_SMA,PRICE_MEDIAN,0)) { if(Open[2]>Close[2]&&Close[1]>Open[2]) { OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-(100*Point),Ask+(300*Point),NULL,9595,0,clrBlue); } } count= Bars; } }
Files:
//+------------------------------------------------------------------+ //| ProjectName | //| Copyright 2018, CompanyName | //| http://www.companyname.net | //+------------------------------------------------------------------+ extern int MA_fast = 21; extern int MA_slow = 50; extern double RiskPerTrade = 0.01; extern int MagicBuy = 9595; extern int MagicSell = 8585; int count= Bars; void OnTick() { if(count!=Bars) { if(Close[1]<iMA(NULL,0,MA_slow,0,MODE_SMA,PRICE_MEDIAN,0)&&Close[1]<iMA(NULL,0,MA_fast,0,MODE_SMA,PRICE_MEDIAN,0)) { if(Open[2]<Close[2]&&Close[1]<Open[2]) { if(OrdersTotal()==0) { OrderSend(Symbol(),OP_SELL,1,Bid,3,0,0,NULL,MagicSell,0,clrRed); } else if(OrdersTotal()!=0) { for(int i=OrdersTotal()-1; i>=0; i--) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { if(OrderMagicNumber()==MagicBuy) { OrderClose(OrderTicket(),OrderLots(),Bid,3,clrNONE); OrderSend(Symbol(),OP_SELL,1,Bid,3,0,0,NULL,MagicSell,0,clrRed); } } } } } } if(Close[1]>iMA(NULL,0,MA_slow,0,MODE_SMA,PRICE_MEDIAN,0)&&Close[1]>iMA(NULL,0,MA_fast,0,MODE_SMA,PRICE_MEDIAN,0)) { if(Open[2]>Close[2]&&Close[1]>Open[2]) { if(OrdersTotal()==0) { OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,NULL,MagicBuy,0,clrBlue); } else if(OrdersTotal()!=0) { for(int j=OrdersTotal()-1;j>=0; j--) { if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES)) { if(OrderMagicNumber()==MagicSell) { OrderClose(OrderTicket(),OrderLots(),Ask,3,clrNONE); OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,NULL,MagicBuy,0,clrBlue); } } } } } } count= Bars; } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+
I think I put all the codes of the parameters you want in these codes
Check and tell if there is no problem
If you see, the code is not profitable
It can be for the following reasons
1- He must trade in specific hours
2- It must have a news filter
3- Have a capital management filter
4- It has a trail stop filter
And...
.
.
.
.
In the tester strategy
Test in different time frames and different currencies
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
2.Must be tuch fast MA ( period 21 method liniar)
3. One candle.