//+------------------------------------------------------------------+ //| 5-digit-code.mq4 | //| Copyright © 2009, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" extern int StopLoss = 50; extern int TakeProfit = 50; double myPoint; // Replaces Point for use with 5 digit brokers //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- myPoint = SetPoint(); //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- double GapInPips, myStopLoss, myTakeProfit; myStopLoss = StopLoss * myPoint; myTakeProfit = TakeProfit * myPoint; GapInPips = NormalizeDouble((Bid - High[1]) / myPoint, 0); //---- return(0); } //+------------------------------------------------------------------+ double SetPoint() { double mPoint; if (Digits < 4) mPoint = 0.01; else mPoint = 0.0001; return(mPoint); }