can someone pls help

 

Hi expert,

i try to write a code for stop loss. i wanted to write the open position hit SL or closed the position if MA crossed. 

this is my SL for buy

 double sl= ask -InpStopLoss * SymbolInfoDouble(_Symbol,SYMBOL_POINT) ||fastbuffer[1] >= slowbuffer [1] && fastbuffer [0] < slowbuffer [0];


this is my SL for sell

double sl= bid +InpStopLoss * SymbolInfoDouble(_Symbol,SYMBOL_POINT) || fastbuffer[1] <= slowbuffer [1] && fastbuffer [0] > slowbuffer [0];


can anyone can help me on this?

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
To obtain the current market information there are several functions: SymbolInfoInteger() , SymbolInfoDouble() and SymbolInfoString() . The first...
 
for starters. your ask and bid around the wrong way.