help me transfer Ninja program to MT4, only four function

 
i got the Ninja program

ex:

 1. Low[10] < Open[BarsSinceEntry()] - ATR(Close, 20)[BarsSinceEntry()] * stopLossATR

 MQL4:??

2. stopvalue = Math.Max(stopvalue, Position.AvgPrice + 10.8 * (Close[0] - Position.AvgPrice)); 

MQL4:?? 

3. does  SMA(200)[0]  is same MT4( double ima1= iMA(NULL,PERIOD_D1,200,0,MODE_SMA,PRICE_CLOSE,0) ;

4  Low[0] < MIN(Low, 100)[1]

MQL4:?? 


But i don't know how to transfer to MT4

Thanks very much!

 
pclovec:
i got the Ninja program

But i don't know how to transfer to MT4

I don't know ninja but I'll take a stab at it.
    for(int pos = OrdersTotal()-1; pos >= 0 ; pos--) if (
        OrderSelect(pos, SELECT_BY_POS)            // Only my orders w/
    &&  OrderMagicNumber() == Magic.Number         // my magic number
    &&  OrderSymbol()      == Symbol() ){          // and period and symbol

        //1 Low[10] < Open[BarsSinceEntry()] - ATR(Close, 20)[BarsSinceEntry()] * stopLossATR
        int BarsSinceEntry = iBarShift(NULL, 0, OrderOpenTime() );
        double atrAtOpen   =      iATR(NULL, 0, 20, BarsSinceEntry);

        //2 Math.Max(stopvalue, Position.AvgPrice + 10.8 * (Close[0] - Position.AvgPrice))
        double position.AvgPrice = 0;
        for (int shift=1; shift <= BarsSinceEntry; shift++) position.AvgPrice += Close[shift];
        position.AvgPrice /= BarsSinceEntry;
        stopvalue = MathMax(...

        //4 Low[0] < MIN(Low, 100)[1]
        min.low=Low[Lowest(NULL,0,MODE_LOW,100,1)];

//3. does  SMA(200)[0]  is same MT4( double ima1= iMA(NULL,PERIOD_D1,200,0,MODE_SMA,PRICE_CLOSE,0) ;
only on the D1 chart.
 

thanks very much,i will look at it.