Hello everyOne, I have Super trend AFL, AmiBroker, Indicator Code, Plz Help To convert INTO MQ4.

 
/* Done      by    Rajandran R */
/* Author of www.marketcalls.in  */

_SECTION_BEGIN("SuperTrend");
SetBarsRequired(100000,0);
GraphXSpace = 15;
SetChartOptions(0,chartShowArrows|chartShowDates);

Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() ); 


_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g,
Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

PositionSize = 100000;

Factor=Optimize("Factor",2,2,10,1);
Pd=Optimize("ATR Periods",11,1,20,1);
Up=(H+L)/2+(Factor*ATR(Pd));
Dn=(H+L)/2-(Factor*ATR(Pd));
iATR=ATR(Pd);
TrendUp=TrendDown=Null;
trend[0]=1;
changeOfTrend=0;
flag=flagh=0;

for (i = 1; i <BarCount-1; i++) {
      TrendUp[i] = Null;
      TrendDown[i] = Null;
     
      trend[i]=1;
   
      
      if (Close[i]>Up[i-1]) {
         trend[i]=1;
         if (trend[i-1] == -1) changeOfTrend = 1;
         
      }
      else if (Close[i]<Dn[i-1]) {
         trend[i]=-1;
         if (trend[i-1] == 1) changeOfTrend = 1;
      }
      else if (trend[i-1]==1) {
         trend[i]=1;
         changeOfTrend = 0;       
      }
      else if (trend[i-1]==-1) {
         trend[i]=-1;
         changeOfTrend = 0;
      }

      if (trend[i]<0 && trend[i-1]>0) {
         flag=1;
      }
      else {
         flag=0;
      }
      
      if (trend[i]>0 && trend[i-1]<0) {
         flagh=1;
      }
      else {
         flagh=0;
      }
      
      if (trend[i]>0 && Dn[i]<Dn[i-1]){
         Dn[i]=Dn[i-1];
                }
      
      if (trend[i]<0 && Up[i]>Up[i-1])
        { Up[i]=Up[i-1];
                }
      
      if (flag==1)
       {  Up[i]=(H[i]+L[i])/2+(Factor*iATR[i]);;
        } 
      if (flagh==1)
        { Dn[i]=(H[i]+L[i])/2-(Factor*iATR[i]);;
         }
      if (trend[i]==1) {
         TrendUp[i]=Dn[i];
         if (changeOfTrend == 1) {
            TrendUp[i-1] = TrendDown[i-1];
            changeOfTrend = 0;
         }
      }
      else if (trend[i]==-1) {
         TrendDown[i]=Up[i];
         if (changeOfTrend == 1) {
            TrendDown[i-1] = TrendUp[i-1];
            changeOfTrend = 0;
         }
      }
   } 

Plot(TrendUp,"Trend",colorGreen);
Plot(TrendDown,"Down",colorRed);

Buy = trend==1;
Sell=trend==-1;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=Sell;
Cover=Buy;


BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);


Title = EncodeColor(colorWhite)+ "Super Trend AFL code from www.marketcalls.in"
+ " - " +  Name() + " - " + EncodeColor(colorRed)+ Interval(2) +
EncodeColor(colorWhite) +
 "  - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+"  "+"Hi-"+H+" 
"+"Lo-"+L+"  "+
"Cl-"+C+"  "+ "Vol= "+ WriteVal(V)+"\n"+ 
EncodeColor(colorLime)+
WriteIf (Buy , " GO LONG / Reverse Signal at "+C+"  ","")+
WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" 
","")+"\n"+EncodeColor(colorYellow)+
WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy  , "Total Profit/Loss for the Last trade
Rs."+(SellPrice-C)+"","");

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);       
              
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45); 
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);    
                 
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

_SECTION_END();
 

mitul67001:

Hello everyOne, I have Super trend AFL, AmiBroker, Indicator Code, Plz Help To convert INTO MQ4.

 

<CODE REMOVED> 

Please edit your post . . . 

 

Use SRC 

 


 Please edit your original post . . .

 

Hello,

This is  the  best  indicator, Really want  to run in my  mt4,

 
if possible than help me,
 
Since there are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.
 
Okay,  Man  Thanku for  u r  kind  support.
Reason: