EA-資金檢查和手數計算

資金檢查code

extern double    Lots = 0.1;
if(AccountFreeMargin()<(1000*Lots))
    {
        Print("We have no money. Free Margin = ", AccountFreeMargin()); 
        return(0);
    }

手數計算orm

double    calculatelot()
    {
        extern double     MaxLot  
        extern double     MaxMargin   = 0.3; 
        lot=NormalizeDouble(MaxMargin * AccountBalance()/AccountLeverage(),1);
        if(lot<0.1)  lot=0.1;
        if(lot>MaxLot)  lot=MaxLot;
        return(lot);
    }
相關文章
相關標籤/搜索