PDA

View Full Version : ATM Based on Calcualtion of previous day


iamwillj
02-18-2010, 12:42 PM
Is it possible to create an ATM strategy that will do the following:

1. Add the LOW, HIGH, CLOSE and Divide previous candle
2. Take that number and compare with the next candle
3. Make an entry at the current candle based UP or down if it hits that particular number.

Thanks,
Will

NinjaTrader_RyanO
02-18-2010, 12:58 PM
Hi Will,

Thank you for your post.

This would not be possible via an ATM strategy, as that type of strategy is designed for manual order entry.

This, would be possible using NinjaScript, and you could create an automated strategy that scans based on the conditions for 1 and 2, and when met an ATM strategy order is input.

Please refer to the following section in the help guide.
http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?DevelopTradingLogic

If you have any additional questions about the process you can post in the NinjaScript section of this forum for other users input, in addition to our own support throughout the process.

iamwillj
02-18-2010, 01:02 PM
Thanks for the reply.

Is it possible you can give me an highlevel example of how to create this is Ninja Script? Just the calulation peice.

Thanks

NinjaTrader_Tim
02-18-2010, 01:47 PM
Hi iamwillj,

You could do something like the following under OnBarUpdate()

double previous;

previous = ((Low[0] + High[0] + Close[0]) / Close[1]);

if (Close[0] > previous)
{
EnterLong(1, "Enter long");
}

however, I'm not 100% sure what you mean by
1. "Divide previous candle"
2. "compare with the next candle"

please clarify so that I can assist you best.