You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to limit my orders based on my available equity. Can anyone see what i am doing wrong?
***************************************************
//---- input parameters
extern bool ShortOnly = true;
extern bool BuyOnly = true;
extern int TakeProfit = 20;
extern int ScaleTradeEntry = 10;
extern double Risk = 0.1;
extern int MinPercentMargin = 500;
extern double Key = 0;
***************************************************
//---- go trading only for first tick of new bar
// if(Volume[0]>1) return;
if (AccountMargin() != 0)
{
if (AccountEquity()/AccountMargin() < MinPercentMargin*0. 01)
{
Print("Trading suspended: Not enough Margin Left");
return;
}
}