NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-07-2011, 05:00 AM   #1
Henry123
Junior Member
 
Join Date: Nov 2010
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Exclamation 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:
Quote:
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:

http://forex-indicators.net/files/in...SweetSpots.mq4
Henry123 is offline  
Reply With Quote
Old 04-07-2011, 05:59 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

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 -

http://www.ninjatrader.com/partners#...pt-Consultants
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Tags
lines, points, spot, sweet, sweetspots

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Points Histogram to determine historical points distribution Trader.Jon Strategy Analyzer 6 10-23-2010 07:17 AM
Feedback: NT7 Hotkey: Next Workspace - sweet. shawnj Suggestions And Feedback 1 10-15-2010 02:38 AM
Roll over Pips/Points / Swap points mefTrader Strategy Analyzer 1 08-20-2010 06:16 AM
order markers not in right spots on reload foxthorn Charting 10 05-18-2010 09:25 AM
Performance in points instead of %? Antraman ATM Strategies (Discretionary Trading) 2 06-17-2006 10:39 PM


All times are GMT -6. The time now is 11:06 PM.