Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Shawn B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alifarahani, Today, 09:40 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by RookieTrader, Today, 09:37 AM
    4 responses
    18 views
    0 likes
    Last Post RookieTrader  
    Started by PaulMohn, Today, 12:36 PM
    0 responses
    5 views
    0 likes
    Last Post PaulMohn  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    40 views
    0 likes
    Last Post love2code2trade  
    Started by junkone, Today, 11:37 AM
    3 responses
    26 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X