Last night was the 1st time I've really messed around with any Strategy trading and the main problem I'm running into is getting the stoploss and profit target to work on Ninjatrader.
Have any of you guys programmed much on there?
I attached a file of the simulated return for the previous 2 week.
This is the bullish part of a 2 part system i want to put together and it's looking alright so far if i could ever figure out how to exit sometime before the close.
Here's the major part of the code.
even switching the "true"/"false" setup didn't help out any. It just held a single contract thruout the entire simulation
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
SetProfitTarget("", CalculationMode.Percent, 0.1);
SetStopLoss("", CalculationMode.Percent, 0.25, false);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(GetCurrentAsk() + 2 * TickSize, Bollinger(2, 14).Lower, 2))
{
EnterLong(DefaultQuantity, "");
}
}
alright thanks
Have any of you guys programmed much on there?
I attached a file of the simulated return for the previous 2 week.
This is the bullish part of a 2 part system i want to put together and it's looking alright so far if i could ever figure out how to exit sometime before the close.
Here's the major part of the code.
even switching the "true"/"false" setup didn't help out any. It just held a single contract thruout the entire simulation
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
SetProfitTarget("", CalculationMode.Percent, 0.1);
SetStopLoss("", CalculationMode.Percent, 0.25, false);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(GetCurrentAsk() + 2 * TickSize, Bollinger(2, 14).Lower, 2))
{
EnterLong(DefaultQuantity, "");
}
}
alright thanks