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

No Entry if no Crossover since Exit

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

    #16
    Originally posted by Hammerhorn View Post
    I was almost certain that this would turn the entry gate to off until the next crossover event. Ah, I think I just got it, it is only turning the entry gate off during a long trade. How do I convert that to if a long trade occurred it is off until a crossover?
    Code:
    if (Position.MarketPosition == MarketPosition.Long) this.TradeEnabledLong = false;
    That is what that statement does, but the key is right there. You have to be long when the tick that triggers the statement arrives.

    You could of course turn off the gate from OnExecution(), when the order is filled. That way, it is turned off because the trade took place, not because you are in a particular position at a particular time. Look in the NT Help.
    Last edited by koganam; 05-28-2013, 05:00 PM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Working...
    X