NexusFi: Find Your Edge


Home Menu

 





Ninja Trader Strategy Wait 10 bars before entering into a trade.


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one RJay with 2 posts (2 thanks)
    2. looks_two wallsteetking with 2 posts (0 thanks)
    3. looks_3 traderwerks with 2 posts (1 thanks)
    4. looks_4 kandlekid with 1 posts (0 thanks)
    1. trending_up 3,582 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 7 posts
    2. attach_file 2 attachments




 
Search this Thread

Ninja Trader Strategy Wait 10 bars before entering into a trade.

  #1 (permalink)
wallsteetking
MN
 
Posts: 25 since Feb 2011
Thanks Given: 4
Thanks Received: 0

Hi guys is it possible to tell Ninjatrader when a condition is meet that it waits 10 bars before entering into the trade.

For example lets say I have a strategy to go long when the 20 EMA crosses above the 50 EMA line. When this condition is met , it should wait 10 bars THEN enter into the trade.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
26 thanks
What is Markets Chat (markets.chat) real-time trading ro …
15 thanks
ApexTraderFunding.com experience and review
14 thanks
GFIs1 1 DAX trade per day journal
13 thanks
EG Indicators
11 thanks
  #3 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 759
Thanks Received: 787



wallsteetking View Post
Hi guys is it possible to tell Ninjatrader when a condition is meet that it waits 10 bars before entering into the trade.

For example lets say I have a strategy to go long when the 20 EMA crosses above the 50 EMA line. When this condition is met , it should wait 10 bars THEN enter into the trade.


When the 2 EMA's cross, record and save the count value of CurrentBar. When CurrentBar +10 is met, enter trade.

RJay

Reply With Quote
Thanked by:
  #4 (permalink)
 traderwerks   is a Vendor
 
Posts: 692 since Jun 2009
Thanks Given: 436
Thanks Received: 465


wallsteetking View Post
Hi guys is it possible to tell Ninjatrader when a condition is meet that it waits 10 bars before entering into the trade.

For example lets say I have a strategy to go long when the 20 EMA crosses above the 50 EMA line. When this condition is met , it should wait 10 bars THEN enter into the trade.

Instead of using EMA(20)[0] , use EMA(20)[10] after making sure you have enough bars of data.

Math. A gateway drug to reality.
Reply With Quote
  #5 (permalink)
wallsteetking
MN
 
Posts: 25 since Feb 2011
Thanks Given: 4
Thanks Received: 0


traderwerks View Post
Instead of using EMA(20)[0] , use EMA(20)[10] after making sure you have enough bars of data.


RJay View Post
When the 2 EMA's cross, record and save the count value of CurrentBar. When CurrentBar +10 is met, enter trade.

RJay

RJay is it possible to do this on the strategy wizard??

traderwerks
I tried it but does not work. I included a picture to explain my issue with the strategy.

Thank you guys for your help.

Attached Thumbnails
Click image for larger version

Name:	EXAMPLE.jpg
Views:	235
Size:	91.3 KB
ID:	52891  
Reply With Quote
  #6 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 759
Thanks Received: 787


wallsteetking View Post
RJay is it possible to do this on the strategy wizard??

traderwerks
I tried it but does not work. I included a picture to explain my issue with the strategy.

Thank you guys for your help.


I think traderwerks idea is better because it allows more flexibility and is easier to code.

You can use current market position to keep trade from happening if movement is unfavorable.

RJay

Reply With Quote
Thanked by:
  #7 (permalink)
kandlekid
College Point, NY (Queens)
 
Posts: 63 since Nov 2009
Thanks Given: 5
Thanks Received: 20


traderwerks View Post
Instead of using EMA(20)[0] , use EMA(20)[10] after making sure you have enough bars of data.

This gets the EMA(20) 10 bars ago, but how do you know that the crossing occurred there ? Even if you compare EMA(20)[10] to EMA(50)[10], you still may not know that the crossing occurred there.

I agree with rjay, I think saving the CurrentBar at the crossing is the way to go. Compare apples to apples (bar nums to bar nums).

Reply With Quote
  #8 (permalink)
 traderwerks   is a Vendor
 
Posts: 692 since Jun 2009
Thanks Given: 436
Thanks Received: 465

Here, it was just easier to write it than explain it.

I put the code int the download section Lagged [AUTOLINK]Moving Average[/AUTOLINK] Crossover.

Math. A gateway drug to reality.
Attached Thumbnails
Click image for larger version

Name:	WSK AAPL (Daily)  6_10_2011 - 10_25_2011.jpg
Views:	201
Size:	79.1 KB
ID:	53138  
Reply With Quote
Thanked by:




Last Updated on October 26, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts