Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hello ,
i'm looking to get help with implementing an ATM strategy into script strategy.
very simple stuff for a programmer, or for a person who has NT trading experience.
will really appreciate your time and experience.
Can you help answer these questions from other members on NexusFi?
I've written a lot of strategies that use Ninja's ATMs. Post what you have so far and what problems you are running into, and someone will likely help. I'll try to help to, but having not used NT for such a long time I am a bit rusty
If you are wanting someone to do it for you, you should make your request more clear that you are looking to hire a programmer - and they can contact you via PM to discuss details.
than you for prompt reply, Mike.
am looking to have my ATM strategy to be triggered by a Ninja Script, which is very simple.
Go long or short on cross above of two EMA's and exit long or short on a cross of the opposite direction.
when the position is open i need this position to be managed by my ATM strategy. and whatever shares are left open to be closed by NT on the opposite cross.
So far, the script i have triggers on the MA crossover the ATM strategy i need. But it does not close the position in the opposite cross. Please have a look at my script below and advise me how to rectify this problem
Your time and efforts are greatly appreciated. PLEASE let me know.
Thanks
NT SCRIPT:
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// ENTER LONG & EXIT LONG ONLY
/// </summary>
[Description("ENTER LONG & EXIT LONG ONLY")]
public class LONG : Strategy
{
#region Variables
// Wizard generated variables
private int fAST = 15; // Default setting for FAST
private int sLOW = 35; // Default setting for SLOW
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(EMA(15), EMA(35), 1))
{
//string a = "b12345";
string a = GetAtmStrategyUniqueId();
string orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Action.Buy, OrderType.Market, 0, 0,TimeInForce.Day, orderId, "TNA 50 SHARES",GetAtmStrategyUniqueId());
Alert("CROSS ABOVE", Priority.High, "ENTER LONG", "", 0, Color.White, Color.Black);
}