I have been trying to program a custom strategy using NinjaScript that allows me to do the following:
a) Manually enter my order on my DOM
b) Have Ninja Trader automatically manage the order that I have placed after the entry is elected.
This is what I want to be able to do:
1) I want to be able to enter the trade manually on my DOM.
a) The trade will be a Stop Limit order for entry, with an Auto OCO using market orders for the stop and target.
2) Upon the trade being initiated via the entry price being hit, the stop and target values inputted into the Auto-OCO bracket order should be placed.
(a) The initial stop needs to be 8 ticks.
(b) The initial target needs to be 5 ticks.
Up to this point, there is not problem...just placing a bracket order. Here is where things get tricky, and where I am currently stuck:
3) The automated trade management component needs to use a OHLC minute chart's price bars as the basis for the trailing stop. The denomination of the minute chart does not matter.
(a) Upon the trade being triggered the stop is 8 ticks and the target is 5 ticks.
(b) After the current OHLC minute bar in which the entry point is triggered becomes fully formed, the stop changes. It becomes either the high or low of that minute bar +1 or -1 tick, depending on if the trade is a buy or a sell.
a)For a sell the stop would be the high of the bar +1 tick.
b) For a buy the stop would be the low of the bar -1 tick.
(b) As each trade moves forward in time, the stop moves to the next completed OHLC minute bar +1 tick or -1 tick depending on if the trade entry is a buy or sell.
I am afraid that my attempt at writing the Ninjascript that could accomplish this task is inadequate at best....and it is possible that I may have to hire someone in order to get this strategy written.
But any help is much appreciated!!!!!!!! Thank you in advance!
Comment