Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Fractal Indicator
Collapse
X
-
Interesting.
Can your post what you tried?
It would be easier for me to fix your code, rather than code it from scratch.
thanks.
Originally posted by ssijbabu View PostHi All,
I am new to ninjatrader and i need a fractal indicator. I tried programming but i am unable to create a proper one. can someone try this?
Here is a document on fractal and a sample code.
1)Whatis fractal?
Fractal The Fractal indicator is available in the “Opening point of the position” and “Closing point of the position” slots of Forex Strategy Builder. Its source code is published in Fractal Source Code Internet page. If you have any questions concerning the
2) Sample Code
Fractals (Page 1) — Technical Indicators — Forex Software — Create and Test Forex Strategies
Regards
Sujay
-
Originally posted by NinjaTrader_Bertrand View PostWelcome to our forums here Sujay, did you look already into the Fractals indicators offered in our sharing section on these forums?
http://www.ninjatrader.com/support/f...fractal&desc=1
Hi NinjaTrader_Bertrand,
I checked the code of bwFractals? is it identifying all the 7 patterns?
Comment
-
Sorry would not be too familiar with both scripts you compare - however the fractal shared on our forums appears to be looking for the regular pivot pattern and up to 4 matching highs / lows to identify the fractal, I believe this comes very close to what you look for. Best would be comparing outcomes generated on your instruments / timeframes of interest.
Comment
-
Hi sledge,Originally posted by sledge View PostInteresting.
Can your post what you tried?
It would be easier for me to fix your code, rather than code it from scratch.
thanks.
Here is the code i tried. Only the upper Fractal line is coaded.
Regards,
SujayAttached Files
Comment
-
The first thing that you need to do would be to correct your indexing. NT indexes in the manner exactly opposite to what you have done: the index for the bar 4 bars into the past is 4, NOT -4. etc.,Originally posted by ssijbabu View PostHi sledge,
Here is the code i tried. Only the upper Fractal line is coaded.
Regards,
Sujay
Once that is corrected, your code actually looks correct, but we can always do a review at that time, if you are still having issues.
Comment
-
Hi All,
I finally completed the indicator. Thanks to all for you help.
Now i need to build a strategy using this.
Strategy 1:
Enter:
Enter long when the price cross upper line or short when the price cross lower line.
Exit:
At the end of the day (close price of the day).
Strategy 2:
Enter:
Enter long when the price cross upper line or short when the price cross lower line.
Exit: (Fixed Stop Loss or Take Profit)
When the price hits stop loss or take profit exit it.
Regards,
SujayAttached Files
Comment
-
Nicely written, but you can make processing more efficient, if you exit after any one fractal pattern is met, instead of testing every pattern on every tick. YikesOriginally posted by ssijbabu View PostHi All,
I finally completed the indicator. Thanks to all for you help.
Now i need to build a strategy using this.
Strategy 1:
Enter:
Enter long when the price cross upper line or short when the price cross lower line.
Exit:
At the end of the day (close price of the day).
Strategy 2:
Enter:
Enter long when the price cross upper line or short when the price cross lower line.
Exit: (Fixed Stop Loss or Take Profit)
When the price hits stop loss or take profit exit it.
Regards,
Sujay
.
IOW, use if ... else instead of if ... if.
This is especially true because you have already coded your pattern from the simplest to the most complex. You might as well exit as soon as you get the simplest pattern-match.
Last edited by koganam; 10-05-2012, 12:30 PM.
Comment
-
Originally posted by koganam View PostNicely written, but you can make processing more efficient, if you exit after any one fractal pattern is met, instead of testing every pattern on every tick. Yikes
.
IOW, use if ... else instead of if ... if.
This is especially true because you have already coded your pattern from the simplest to the most complex. You might as well exit as soon as you get the simplest pattern-match.
Its Done. Here is the updated one.Attached Files
Comment
-
Hi is their an Fractal indicator for NinjaTrader 8? I tried this version but this seems not compatible for NT8.
Comment
-
One variant of this study was ported to NinjaTrader 8 and could be found in our sharing under this link - http://ninjatrader.com/support/forum...d=7&linkid=713
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
602 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
559 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment