is here somebody who could transform this Amibroker or mt4 Code to NinjaTrader? I tried it a couple of times, but dont get it, still a bloody rookie....
Thanks!
Amibroker AFL:
spColor=ParamColor("SP Color", ColorRGB(100,100,0));
SPlgth = ParamToggle("Length of SP Line (Hourly|Daily)", "Hourly|Daily");
if(SPlgth == 0){
TimeFrameSet( inHourly);
}
else if (SPlgth == 1){
TimeFrameSet( inDaily);
}
ssp1= C / ticdiv;
ssp1= ssp1 - ssp1%50;
ssp2= ssp1 + 50;
ds1= ssp1*ticdiv;
ds2= ssp2*ticdiv;
TimeFrameRestore();
if(SPlgth == 0){
sp1 = TimeFrameExpand(ds1,inHourly);
sp2 = TimeFrameExpand(ds2,inHourly);
sp1 = sp1 * (Hour() == LastValue(Hour()));
sp2 = sp2 * (Hour() == LastValue(Hour()));
}
else if (SPlgth == 1){
sp1 = TimeFrameExpand(ds1,inDaily);
sp2 = TimeFrameExpand(ds2,inDaily);
sp1 = sp1 * (Day() == LastValue(Day()));
sp2 = sp2 * (Day() == LastValue(Day()));
}
sp1 = IIf(sp1,sp1,Null);
sp2 = IIf(sp2,sp2,Null);
if (ticdiv == 0.01) {
p1 = StrRight( NumToStr( sp1*ticdiv, 4.4 ), 2);
p2 = StrRight( NumToStr( sp2*ticdiv, 4.4 ), 2);
}
else if (ticdiv == 0.0001){
p1 = StrRight( NumToStr( sp1, 4.4 ), 2);
p2 = StrRight( NumToStr( sp2, 4.4 ), 2);
}
PlotText( p1, BarCount+10, LastValue(sp1)-ticdiv, spcolor);
PlotText( p2, BarCount+10, LastValue(sp2)-ticdiv, spcolor);
Plot(sp1,"", spColor ,styleBar | styleDashed | styleNoLabel);
Plot(sp2,"", spColor , styleBar | styleDashed | styleNoLabel);
_SECTION_END();
Comment