- Open Breakout
- [ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4.
- Coding help
In order for somebody to help you, you need to attach the sample code or insert it in your message.
Regards...
Try again.
for(int pos=0; pos<=sum; pos++) { OrderSelect(pos,SELECT_BY_POS,MODE_TRADES); if(OrderSymbol()==Symbol() && OrderMagicNumber()==Expert_ID)continue; int totalpeaks=10; for (int x=0; x<=totalpeaks; x++) { if((macdb<0 && macdb<=macda && macdb<=macdc)||(macdb>0 && macdb>=macda && macdb>=macdc)) peak[x]=macdb; { if (x>0 && peak[x]>peak[x-1] && peak[x]<0 && peak[x-1]<0 && MacdCurrent>SignalCurrent && MacdPrevious<=SignalPrevious && MacdCurrent<0 ) { //---- open a BUY position if (OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stoploss*Points, Ask+TakeProfit*Points,"macd sample",Expert_ID,0,Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend # ", _GetLastError ); return(-1); } return(0); } } { //---- if the MACD has met the zero line top-down, if (x>0 && peak[x]0 && peak[x-1]>0 && MacdCurrent=SignalPrevious && MacdCurrent>0) { //---- open a SELL position if (OrderSend(Symbol(), OP_SELL, Lots,Bid,3,Bid+stoploss*Points,Bid-TakeProfit*Points,"macd sample", Expert_ID,0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend # ", _GetLastError ); return(-1); } return(0); } } } return(0); } }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use