thanx!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Candlestick pattern strategy creation
Collapse
X
-
Candlestick pattern strategy creation
I am trying to use the strategy editor to create a simple candlestick pattern recognition strategy such as go long on morning star, go short on evening star pattern but I am flummoxed as to how to set it up in the editor- can you please throw me a clue or two?
thanx! -
You should search for and read about getting started with strategies. There are also many links to sample ATM strategies available in the forums if you search and read.
It will help if develop a basic understanding of C#
then.... in its simplest form.... in the OnBarUpdate() you will have something like...
if (FirstTickOfBar)
{
if(CandleStickPattern(ChartPattern.MorningStar,3). PatternFound[1]!=0)
AtmStrategyCreate(OrderAction.Buy, oType,High[1]+(1*TickSize),High[1]+(1*TickSize),TimeInForce.Day,TradeValues_ORDER_ID , atmTemplate,TradeValues_ATM_STRATEGY_ID]);
} ...
You will of course have additional code possibly for checking other conditions and or managing the trade. Do some searching for ATM Strategies and AtmStrategyCreate in the forums and help files.
MarkLast edited by mjc4118; 09-09-2010, 09:30 PM.
-
Candlestick pattern strategy creation
Mark,
Thanks so much for your response.
I should have mentioned that I currently have zero ability in C# but I have been successfully creating simple strategies using the NT Strategy Wizard for a while. However I ran into a brick wall when trying to create the condition using the provided operators, ie: ==, >=, != and so on with the candlesticks indicator - I can't figure out what to compare the candlesticks indicator "Morning Star" to. Can this be accomplished using the Strategy Wizard?
All the best
Comment
-
Peter.
To learn enough C# to be dangerous is not difficult. To learn enough to make a living writing code is on the other hand more difficult. If you are working with strategies it may behoove you to try to learn C#. You can download Visual Studio Express 2010 for free from Microsoft and plenty of free educational resources available on the net like: the book "Sams Teach yourself C# in 24 Hours". . . to learn the basics of C# code. This way you can get more flexibility that just writing strategies using the wizard...
Comment
-
Thanks mjc - I have downloaded Visual C Studio and have started working my way through Sams Teach Yourself C# in 24 hours- it's a bit intimidating but obviously worthwhile for the flexibility in Strategy creation that I am looking for.
It's really encouraging to know that there are people who are willing to take time to help out a newbie!
All the best,
Peter
Comment
-
Hi Bertrand,
Is it possible to setup multiple candlestick conditions for a strategy?
Here is what I mean: Say I want to go Long IF the 20SMA is > 50SMA AND I have a Bullish Engulfing OR a Bullish Harami OR a Morning Star. In other words, I want the strategy to go Long definitely if the SMA condition is true and if ANY of the candlestick conditions are true.
I have successfully edited/programmed a singlestick candlestick condition, but am struggling with multiple "OR" statements.
Thanks alot & appreciated.
Comment
-
MKTTHOTS, this is definitely possible, but only directly through code. The strategy wizard is not able to handle multiple OR statements. From your post, the code would look something like this:
Code:if ((SMA(20)[0] > SMA(50)[0]) && (BullishEngolfingConditions || BullishHaramiConditions || MorningStarConditions)) EnterLong()AustinNinjaTrader Customer Service
Comment
-
That works well, I've tied that line of code into the prevoius line I had. One thing I'm aware of is that if I 'break out' of the Wizard and into C# (which I have done a basic course in, but am not a professional), I will not be able to re-enter the wizard mode - is that correct? Any plans to allow more flexibility in this regard to Version 7.0 full release? Thanks again for your help.
Comment
-
Automated candlestick pattern
Hey Everyone! Great forum! Was wondering if it would be difficult to fully automate a simple bearish and bullish engulfing entry where entry would occur at one tick beyond engulfing bar close on a range chart? Possible to automate? If so, who could I hire to create it for me? Thanks ahead of time.
Comment
-
Southsea,
I have most of the code for that here. It is tied to a strategy with a popup window ..you can turn it on an off w/ a button click and If you want to enter an order you click the enter button and it enters on candle close ..I would need to clean it up.... I have not looked at the code in a while ..private message me and I will end you my contact info. We can discuss it then.
Mark
Comment
-
whats the easiest way to address the candlestick pattern indicator for a different period.
im testing on minute data, but i take the values of daily indicators
i added a daily series Add(PeriodType.Day, 1);
and then usually jsut address the daily period
double SMA50 = SMA(Closes[1], 50)[0];
but the candlestick indicator has no period input
CandleStickPattern(ChartPattern.MorningStar,4). PatternFound[0]!=0
i could code the pattern myself, but using the built indicator would be easier.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 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
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment