NexusFi: Find Your Edge


Home Menu

 





help with strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one niki with 3 posts (0 thanks)
    2. looks_two sam028 with 1 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 zeller4 with 1 posts (0 thanks)
    1. trending_up 1,727 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread

help with strategy

  #1 (permalink)
 niki 
wokolina
 
Experience: None
Platform: ninjatrader
Posts: 4 since Mar 2010
Thanks Given: 0
Thanks Received: 1

hi, I am not good with coding and what I looking for to figure out is how to develop a strategy where I can put SMA + some range
eg
 
Code
                            
protected override void Initialize()
 { 
  
SetProfitTarget ("", CalculationMode.Ticks4); 
 
SetStopLoss ("", CalculationMode.Ticks2); 
 
CalculateOnBarClose false
 } 
    
SMA(close4)
 if ( 
price_is_above_SMA_5_ticks 
 {  
enterlong;  //only one time, if price pullback (one tick because second is SL) and cross the fifth tick from SMA again, no more opening position 
  
}
 if ( 
price_is_bellow_SMA_5_ticks 
 {  
entershort//only one time  


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Exit Strategy
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404


Hey Niki,

Not exactly sure how to interpret your request...

Two thoughts to help move it along:

1. Post a screenshot with markups to identify what you mean by this:

Quoting 
//only one time, if price pullback (one tick because second is SL) and cross the fifth tick from SMA again, no more opening position

2. Check out the SampleMACrossover strats on the Ninjatrader forum website and see if that could be altered to accomplish what you want.

kz

Reply With Quote
  #4 (permalink)
 niki 
wokolina
 
Experience: None
Platform: ninjatrader
Posts: 4 since Mar 2010
Thanks Given: 0
Thanks Received: 1

it looks like that

Attached Thumbnails
Click image for larger version

Name:	long_short.jpg
Views:	140
Size:	36.3 KB
ID:	11417  
Started this thread Reply With Quote
  #5 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

I'm not sure to understand the question, but if you want to avoid reversing your positions after each opposite signal, the idea is maybe to do something like:
 
Code
                            
 if ( ( price_is_above_SMA_5_ticks ) && (Position.MarketPosition == MarketPosition.Flat) ) {
enterlong ;
}

if ( ( 
price_is_below_SMA_5_ticks ) && (Position.MarketPosition == MarketPosition.Flat) ) {
 
entershort ;


Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
 eman 
Galveston ,TX
 
Experience: Intermediate
Platform: NT7
Broker: Zaner
Trading: Futures
Posts: 386 since Mar 2010
Thanks Given: 364
Thanks Received: 435

if you're asking for the "formula" to express price_is_above_SMA_5_ticks, try this:
 
Code
if (Close[0] > SMA(Close,4) + 5 * TickSize)
cheers,
-e

Reply With Quote
  #7 (permalink)
 niki 
wokolina
 
Experience: None
Platform: ninjatrader
Posts: 4 since Mar 2010
Thanks Given: 0
Thanks Received: 1


eman View Post
if you're asking for the "formula" to express price_is_above_SMA_5_ticks, try this:
 
Code
if (Close[0] > SMA(Close,4) + 5 * TickSize)
cheers,
-e

yes, that what I'm looking for, I found it on ninja forum but anyway thx.

Started this thread Reply With Quote




Last Updated on April 27, 2010


© 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