ninjatrader ninjascript strategies with secondary entries and consolidated stop loss orders.

Job ID: 31293774

Budget: $10 – $30 USD

regards to all.


i have been trying to create a strategy with specific position management capabilities. below i have outlined a rough sketch of the functionality i have in mind. i want to be able to add a secondary entry and have a consolidated management for the entire position (both entries) with parallel stop loss orders. and it is the stop loss orders that i haven't been able to make work. nt support recommended that i use the onorderupdate and onexecutionupdate methods but i can't make them work. i have created several versions of the strategy, however when running optimizations i keep getting losing trades that are several times what the stop loss should be.


#

if close[0] < ema[0]

ordinary short entry at market { 2 m2k contracts }

create stop loss order for ordinary short entry at +200 ticks from initial average entry price { ordinary short entry }


if time is between 9:30 and 16:00 and high[0] > ( initial average entry price + 80 ticks )

pullback short entry at market { 1 m2k contract }

move stop loss order for ordinary short entry to +110 ticks from combined average entry price { average of ordinary and pullback short entries }

create stop loss order for pullback short entry at +110 ticks from combined average entry price { average of ordinary and pullback short entries }


{ move stops to break even }

if low[0] < ( combined average entry price - 200 ticks )

move both stop loss orders to combined average entry price - 10 ticks


if close[0] > ema[0]


liquidate all short entries

cancel all stop orders


{ long positions would have the same structure, just inverted. i should be able to take care of that if i can get the structure for short positions to work }


#

very well, thanks, regards,


marcos
Related categories: C# Programming Programming