Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

nt8b* - stoptargethandling q?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    nt8b* - stoptargethandling q?

    http://ninjatrader.com/support/helpG...ethandling.htm

    This is in Playback-MR.

    Doing some extensive testing and adding to my strategy this past week, and I increased EntriesPerDirection to 2.

    In a strategy, I have 1 market order entry, and then say later on, based on another condition, I enter Long again.

    This is using the same named entry as the previous entry, so I thought or hoped it would use the same targets for profit and stoploss.

    But it appears to be using it's own unique values.

    I thought changing stoptargethandling would affect this - but it appears it does not.

    So is there anyway to tag along this new entry on the target/stoploss of previous named entry without having to save it and reset it after new entry on same tag?

    I'm also kind of confused.

    In the code below - I set it in State.SetDefaults.

    When I disable the strategy - and then EDIT the strategy in the Control Center strategy tab - it shows "Stop & Target submission .... Per Entry Execution"...So I'm not sure if ByStrategyPosition is even being used. (Entries Per direction is showing 2).

    I haven't done this before(in NT7), so this is a new area for me... so wasn't sure what to expect.

    Thoughts? Suggestions? Is this a bug?


    Code:
    			if (State == State.SetDefaults)
    			{
    				Description					= @"Enter the description for your new custom Strategy here.";
    				Name						= "stoploss_test";
    				Calculate					= Calculate.OnEachTick;
    				EntriesPerDirection			= 2;
    				EntryHandling				= EntryHandling.AllEntries;
    				IsExitOnSessionCloseStrategy		= false;
    				ExitOnSessionCloseSeconds			= 30;
    				IsFillLimitOnTouch			= false;
    				MaximumBarsLookBack			= MaximumBarsLookBack.TwoHundredFiftySix;
    				OrderFillResolution			= OrderFillResolution.Standard;
    				Slippage					= 0;
    				StartBehavior				= StartBehavior.WaitUntilFlat;
    				TimeInForce					= TimeInForce.Gtc;
    				TraceOrders					= false;
    				RealtimeErrorHandling		= RealtimeErrorHandling.StopCancelClose;
    				StopTargetHandling			= StopTargetHandling.ByStrategyPosition;

    #2
    Hello,

    Thank you for the question.

    I wanted to check, what unique values are you seeing for the stop you are setting? I am unsure by the description on exactly what you are seeing or is happening. If you are using the SetStopLoss method with an amount of Ticks, I would expect different prices for the two stops if they happen at two different times.

    I put together a simple script just to test using the same signal name for multiple entries per direction, my test had included a second condition which becomes true after the first so my stops were submitted at very close prices but not exact. Is this the kind of unique values you are referring to? Otherwise this test seemed successful regarding using the same signal name for the stops.

    If not could you provide a more complete sample or more information on what specific code is being used for the stop as you did not say, are you using SetStopLoss from State.Configure or in OnBarUpdate?



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kawalecld, Today, 12:21 PM
    0 responses
    2 views
    0 likes
    Last Post kawalecld  
    Started by farzibopsu, Today, 11:52 AM
    0 responses
    4 views
    0 likes
    Last Post farzibopsu  
    Started by exjayess, Today, 11:04 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by robertlaub, Today, 11:11 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by sdauteuil, Today, 10:28 AM
    0 responses
    6 views
    0 likes
    Last Post sdauteuil  
    Working...
    X