Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Entries Wanted!

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

    Multiple Entries Wanted!

    Question: In my strategy I have 2 Entry Conditions. One is as soon as Bar closes it sets a EnterShortStop a few ticks above/below Close
    Code:
    //STEP 1: ENTER TRADE, ShortStop after Close of DownBar
    			EnterShortStop(scalpLotSize, Close[1] - (entryTrigDist * TickSize), "sellTrade1");
    Sometimes this gets rejected because price moves too fast, but I found a way around it, by placing a 2nd condition
    Code:
    if(Position.MarketPosition != MarketPosition.Short)
    			{	//If Not in Current trade and Price moved back above CLose of Previous Down Bar's Close
    				if(Close[0] > Close[1])
    				EnterShortStop(scalpLotSize, Close[1], "sellTrade1");
    This has been working Great. but my problem is now. I want to add a 3rd and 4th Entry condition, where it opens another position "If Already in a Position", problem I DON'T want to interfere with these last Two Conditions.

    My dilemma is that one of the first 2 conditions will Only Enter a StopOrder "If NOT in Current Position"

    Let me try to summarize: Is there a way to write that if 1st condition Enters ShortStop Order cancel the 2nd Condition's paramaters WITHOUT looking to see If MarketCondition.Short?

    This would solve my problem but I don't know how to do it.


    Hopefully this summary explains it better:

    Code:
    //Entry Condition 1: ShortStop after Close of DownBar
    		EnterShortStop(scalpLotSize, Close[1] - (entryTrigDist * TickSize), "sellTrade1");
    
    //Entry Condition 2: IF Entry 1 is Rejected: and Price Retraces Back Above the Close of last Down Bar's Close, and We're NOT in Current Trade, Enter ShortOrder
    if(Close[0] > Close[1])
    	EnterShortStop(scalpLotSize, Close[1], "sellTrade1");
    
    //Entry Condition 3: If in a Current Trade, and bar closes in my favor, Enter 2nd Trade
    if(Position.MarketPosition == MarketPosition.Short && FirstTickOfBar && Close[1] < Open[1])
    {
    	EnterShortStop(halfLotSize, Close[1] - (entryTrigDist * TickSize), "sellTrade2");
    }
    //This is the Real PROBLEM right Here:
    //Entry Condition 4: If in Current Trade and Entry 3 (sellTrade2) got Rejected, and Price retraces back above Previous DownBar's Close, 
    {
         EnterShortStop(halfLotSize, Close[1], "sellTrade2");
    }
    So you see Everything is FIne until CONDITION 4. because Condition 3 & 4 are just a Copy of Condition 1 & 2. However, #3 and #4 need MarketPosition != flat. but is There another way of writing COndition 4 so that it Does NOT Enter a Trade if COndition 3 entered a Trade

    One possible solution but I don't know how to do it. Is "If Condition 1 Got Rejected --> Enter Condition 2" without Checking to see if we're in a Trade or NOT.

    I could then Copy that for condition 3 & 4. Any idea how to accomplish This?

    #2
    Hello Ginx10k,

    You could use a bool flag for when your third condition entered a trade to then submit the 4th condition when this becomes true.

    You would want to check when the order was accepted in the OnOrderUpdate() method
    Code:
    protected override void OnOrderUpdate(IOrder order)
    {
         if( order.name == sellTrade2" && order.OrderState == OrderState.Accepted)
             myBool = true;
    }
    http://www.ninjatrader.com/support/h...rderupdate.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Awesome thanks so much Buddy!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      651 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      577 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X