Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position entry question

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

    Position entry question

    Have a question about entry:


    I would like to program a Strategy to buy (EnterLong) everytime one line crosses below another. (SMA(5) cross below SMA(10) for example).


    With EntryHandling=AllEntries, the above will process once and hold until the position is closed.

    With UniqueEntries, it will basically do the same thing, unless I have different entry logic and a different name.



    Is there any way to buy each time X crosses under XX, multiple times if neccessary ?

    #2
    Hello Faspomy,

    You can define this with EntriesPerDirection.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      NT Ryan,

      thank you.


      As per their example, how would I change this so that it will buy once everytime SMA(10) crossed SMA(20) ?

      Doesn't EntriesPerDirection = 5; mean that it will enter 5 positions simultaneously (and not seperately) ?



      Code:
      [FONT=Courier New][COLOR=#0000ff]protected override[/COLOR] [COLOR=#0000ff]void[/COLOR] Initialize()[/FONT] 
      [FONT=Courier New]{[/FONT] 
      [FONT=Courier New] EntriesPerDirection = 5;[/FONT] 
      [FONT=Courier New] EntryHandling = EntryHandling.AllEntries;[/FONT] 
      [FONT=Courier New]}[/FONT]
      [FONT=Courier New][COLOR=#0000ff]protected override[/COLOR] [COLOR=#0000ff]void[/COLOR] OnBarUpdate()[/FONT] 
      [FONT=Courier New]{[/FONT] 
      [FONT=Courier New] [COLOR=#0000ff]if[/COLOR] (CrossAbove(SMA(10), SMA(20), 1)[/FONT] 
      [FONT=Courier New]     EnterLong("SMA Cross Entry");[/FONT] 
       
      [FONT=Courier New]}[/FONT]
      Last edited by Faspomy; 02-18-2010, 12:49 PM.

      Comment


        #4
        Hello Faspomy,

        You would change EntriesPerDirection to the number of entries you want to accept in any one direction. You can set this to 3,5,1001, or any other integer.

        Entries per direction is not the same as Order Quantity. If you have it set to 5, it will enter on up to 5 different instances of the rule. If you entered 5 instances of the rule and get another signal, this signal is ignored until one of your positions is closed.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          NT Ryan,

          thanks !

          Comment


            #6
            Another question:

            I would like to use AllEntries in a strategy, to buy multiple positions.
            Problem: I would like to buy (long) and sell (short) in same strategy.

            Can a strategy buy and sell (enter long and short) seperately ?

            Comment


              #7
              Faspomy, you could do this via market orders, but the overall strategy position size would reflect this of course...if you want this separated please use two individual strategies.

              Comment


                #8
                thank you !

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                669 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                378 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                111 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                575 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                580 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X