Skip to content

Instantly share code, notes, and snippets.

@matthewkastor
Created January 23, 2016 21:17
Show Gist options
  • Save matthewkastor/147d48770cd3a540c663 to your computer and use it in GitHub Desktop.
Save matthewkastor/147d48770cd3a540c663 to your computer and use it in GitHub Desktop.
function for opening a Sell order in metatrader 4
// int result = OpenSellOrder(0.01, 0.00300, 0.00900);
int OpenSellOrder(double lots, double stopLossPips, double pipsProfit){
double takeProfit = NormalizeDouble(Bid - pipsProfit, Digits);
double stopLoss = NormalizeDouble(Bid + stopLossPips, Digits);
return OrderSend(Symbol(),OP_SELL,lots,Bid,3,stopLoss,takeProfit,"",MAGICMA,0,clrPink);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment