Quote:
Originally Posted by ElectricSavant
0,Red and 0,Blue does not work when I add them here to get the arrows. Can someone help? I also need those triangles and lines showing the close. Also, where in the code does it specify to close in 5 bars?
ES
MQL4 Code:
void fBuy (){ RefreshRates(); int result = OrderSend(Symbol(),OP_BUY,Lots ,Ask,Slippage ,0,0,"myPickyBreakout",Magic ,0); if (result == -1) { int e = GetLastError(); Print(e ); } Duration = 0;}//+------------------------------------------------------------------+//| Sell |//+------------------------------------------------------------------+void fSell (){ RefreshRates(); int result = OrderSend(Symbol(),OP_SELL,Lots ,Bid,Slippage ,0,0,"myPickyBreakout",Magic ,0); if (result == -1) { int e = GetLastError(); Print(e ); } Duration = 0;}
|
Please do not forget to use code highlighting when inserting MQL code.
MQL4 Code:
int result = OrderSend(Symbol(),OP_BUY,Lots ,Ask,Slippage ,0,0,"myPickyBreakout",Magic ,0);
should become:
MQL4 Code:
int result = OrderSend(Symbol(),OP_BUY,Lots ,Ask,Slippage ,0,0,"myPickyBreakout",Magic ,0, Blue);
MQL4 Code:
int result = OrderSend(Symbol(),OP_SELL,Lots ,Bid,Slippage ,0,0,"myPickyBreakout",Magic ,0);
should become:
MQL4 Code:
int result = OrderSend(Symbol(),OP_SELL,Lots ,Bid,Slippage ,0,0,"myPickyBreakout",Magic ,0, Red);
Don't forget to "Compile".
Duration is the counter of bars since the position is open. MaxDuration is an input parameter, which equals 5 by default:
MQL4 Code:
if (Duration == MaxDuration) { CloseOrder(OT); count = 0; }
|