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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    559 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    546 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X