25.10.2016 Views

Expert Advisor Programming by Andrew R. Young

Expert Advisor Programming by Andrew R. Young

Expert Advisor Programming by Andrew R. Young

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix D<br />

bool VerifyUpperStopLevel(string argSymbol, double argVerifyPrice,<br />

double argOpenPrice = 0)<br />

{<br />

double StopLevel = MarketInfo(argSymbol,MODE_STOPLEVEL) * Point;<br />

if(argOpenPrice == 0) double OpenPrice = MarketInfo(argSymbol,MODE_ASK);<br />

else OpenPrice = argOpenPrice;<br />

double UpperStopLevel = OpenPrice + StopLevel;<br />

if(argVerifyPrice > UpperStopLevel) bool StopVerify = true;<br />

else StopVerify = false;<br />

}<br />

return(StopVerify);<br />

bool VerifyLowerStopLevel(string argSymbol, double argVerifyPrice,<br />

double argOpenPrice = 0)<br />

{<br />

double StopLevel = MarketInfo(argSymbol,MODE_STOPLEVEL) * Point;<br />

if(argOpenPrice == 0) double OpenPrice = MarketInfo(argSymbol,MODE_BID);<br />

else OpenPrice = argOpenPrice;<br />

double LowerStopLevel = OpenPrice - StopLevel;<br />

if(argVerifyPrice < LowerStopLevel) bool StopVerify = true;<br />

else StopVerify = false;<br />

}<br />

return(StopVerify);<br />

double AdjustAboveStopLevel(string argSymbol, double argAdjustPrice, int argAddPips = 0,<br />

double argOpenPrice = 0)<br />

{<br />

double StopLevel = MarketInfo(argSymbol,MODE_STOPLEVEL) * Point;<br />

if(argOpenPrice == 0) double OpenPrice = MarketInfo(argSymbol,MODE_ASK);<br />

else OpenPrice = argOpenPrice;<br />

double UpperStopLevel = OpenPrice + StopLevel;<br />

if(argAdjustPrice

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!