Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble with SMA>SMA

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

    Trouble with SMA>SMA

    Hello guys!
    Having problem with very simple thing and can't resolve it. I know it's simple, but very hard to me.

    I have Two SMA (not exactly SMA, but in case the same thing). Have this code:

    If (SMA(Fast)[0] > SMA(Slow)[0]{
    EnterLongLimit(0, true, DefaultQuantity, LowBorder, "Long Limit");
    }

    In this case I have entries every time as price comes to my LowBorder value.
    But I want to do next condition:
    Enter only ONCE when SMA(Fast) > SMA(Slow) from entry order. Not more times.
    I have SMA(Fast)<SMA(Slow) with short limit of course.

    Cant' understand where I need to put "flags" to get those conditions and enters what i want.

    Thanks!

    #2
    Hello YevhenShynkarenko,


    You would need to use the EntriesPerDirection method to specify the maximum number of entries allowed per direction while a position is active. Use the EntryHandling method to set how the orders will be handled when using EntriesPerDirection.


    If you set the EntryHandling method to "EntryHandling.AllEntries", all order entry methods are tracked until the maximum allowable entries set by the EntriesPerDirection property has been reached while in an open position.

    If you set the EntryHandling method to "EntryHandling.UniqueEntries", order entry methods are tracked until the maximum allowable entries set by the EntriesPerDirection property per each uniquely named entry.



    I have included the EntriesPerDirection and EntryHandling help guides to assist you with this further.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    41 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X