NexusFi: Find Your Edge


Home Menu

 





Developing Basics of a Strategy - Order Management Commands


Discussion in NinjaTrader

Updated
    1. trending_up 3,263 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

Developing Basics of a Strategy - Order Management Commands

  #1 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404


Elliott Wave View Post
Everything I have ever done I learned from simple indicator 'tweaks'.

I think sharing your knowledge in this area could be very helpful. My biggest tip is just to study existing indicators and if there is a tweak you want to make to an indicator, find one that already has the desired functionality and 'hack it in'.

While often frustrating, 'hacking stuff together' can be quite rewarding and when you hit a snag, the fact that NT uses C# means there are plenty of educational resources available.

The way I see it, if I can create useful indicators (if not the most I have close to the most indicators shared in the NT file sharing section) with almost no programming skill/knowledge, anybody can do it! The easier it is for novice programmers to get over the initial hurdle of believing they can create something useful, the more the larger NT community benefits.


Hi Elliott Wave,
I've often looked at your shared indicators on NT forum and appreciate your contributions.

Now I've been working with the various sample strategies. As you know, they demonstrate various functions separately (ie intrabar entries/exits, daily stop / profit goals, exit on session closes, moving or trailing stops, etc.). I'm wondering if you have some strategy templates that encompass several of these features that you've shared or are willing to share. I'm not even looking for specific rules that would make a strategy 'proprietary' but rather how a basic_ma_crossover could be enhanced to show and work within several functions. See the template I've started:
 
Code

////////////////////////////////////////////////////////////
// /// FUNCTIONS /////////////////
privatevoid PrintState()
{
Print("//////////////////////////////////");
Print("_A_1_Strategy_Template_v00");
Print("TradeState: " +tradeState);
Print("TradePhase: " +tradePhase);
Print("TradeNumber: " +tradeNumber);
Print("Position.AvgPrice" +Position.AvgPrice);
return;
} 

privatevoid LongTrendTrade()//This function will put you in a long trade if you were flat
{
}
privatevoid ShortTrendTrade()//This function will put you in a short trade if you were flat
{

}
privatevoid LongScalpTrade()//This function will put you in a long trade with tighter targets / stops
{
}
privatevoid ShortScalpTrade()//This function will put you in a short trade with tighter targets / stops
{
}
privatevoid LongTrail()//This function will allow a trailing stop to be placed after achieving a certail profit level
{
}
privatevoid ShortTrail()//This function will allow a trailing stop to be placed after achieving a certail profit level
{
}
privatevoid LongTightenStop()//This function will move the protective stop based on some retracing signal
{
}
privatevoid ShortTightenStop()//This function will move the protective stop based on some retracing signal
{
}
privatevoid ExitPosition()//This will exit the position (normally as an emergency stop)
{
ExitLong();
ExitShort();
}
Appreciate any advice or direction you could give.
Thanks,
Kirk (zeller4)

Started this thread Reply With Quote





Last Updated on July 18, 2009


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts