Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sweet Spots/Points

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sweet Spots/Points

    Hey Guys,
    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:
    TicDiv= Param("Tic or PIP value",0.0001,0.0001,0.01,0.01);
    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();
    mt4 code:


    #2
    Hi Henry123, if no ones takes it up here in the community then you could contact a NinjaScript consultant to create this professionally for you -

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X