• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Execute when bar crosses SMA

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

  • NinjaTrader_PaulH
    replied
    Hello JT1230,

    Thanks for your post.

    As you are using the Bollinger indicator it would make sense to use that as the comparison. You could code something like:

    if (Position.MarketPosition == MarketPosition.Short && Close[0] > = Bollinger(2, 20).Middle[0])
    {
    ExitShort();
    }

    You may want to change Close for High, depends on your needs,

    ExitShort: "Generates a buy to cover market order to exit a short position." Helpguide link: http://ninjatrader.com/support/helpG...?exitshort.htm

    Leave a comment:


  • JT1230
    started a topic Execute when bar crosses SMA

    Execute when bar crosses SMA

    I know it's silly but how do I execute a buy to cover when it crosses 20 period SMA?
    Attached Files

Latest Posts

Collapse

Topics Statistics Last Post
Started by Roman_786, 05-16-2019, 05:31 AM
11 responses
206 views
0 likes
Last Post brucerobinson  
Started by Nutricer, Today, 03:24 AM
0 responses
2 views
0 likes
Last Post Nutricer  
Started by DimaFridrich, Today, 01:54 AM
0 responses
8 views
0 likes
Last Post DimaFridrich  
Started by ttodua, Today, 01:12 AM
0 responses
7 views
0 likes
Last Post ttodua
by ttodua
 
Started by NinjaCustomer, Today, 01:01 AM
1 response
12 views
0 likes
Last Post NinjaTrader_ChrisSch  
Working...
X