NexusFi: Find Your Edge


Home Menu

 





HOW!!?? Turn SetStopLoss into a ExitLongLimit


Discussion in NinjaTrader

Updated
    1. trending_up 2,964 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

HOW!!?? Turn SetStopLoss into a ExitLongLimit

  #1 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

Greets!

I have (for me) intriguing idea after taking a long look ayt how the SetStopLoss was having my automated strategy trades finish: it looks like there could be another 3 or more ticks of profit available beyond what price was selected as the 'stop loss limit'.

I tried just adding another 3 ticks to the calculation I was using, with a small amount of success (ie same# of trades are taken, small increase in net points) but if I try to make the process into a ExitLongLimit the results are not fruitful (ie dont ask)

 
Code
				//**************************************
                //          Adjust TrailLong Exit
                //**************************************
				double TRAILtickAdjustLONG = 0;
			//
						if (  (BarsSinceEntry(0, "",0)) >= iTrailStartBarNum )
				{	 // Rule#1   flat for 3 bars in a row
					if(	iTrailUseTSr1 == 1	&& sTrailSS[0] == 1 && vTrailCt >= 3) 
						TRAILtickAdjustLONG++;
					// Rule#2    flat for 2 bars in a row  
					if(	iTrailUseTSr2 == 1	&& sTrailSS[0] == 1 && vTrailCt >= 2)
						TRAILtickAdjustLONG++;
					// Rule#3  TSST EXIT DOWNtrending
					if(	iTrailUseTSr3 == 1	&& sExitSS[0] == -1)
						TRAILtickAdjustLONG++;
					// Rule#4  fast period EXITing EMA1 is in a DOWNslope
					if(	iTrailUseEMA1r4 == 1 && Falling(sExitMA1) )
						TRAILtickAdjustLONG++;
					// Rule#5  slow period EXITing EMA2 is in a DOWNslope
					if(	iTrailUseEMA2r5  == 1	&& Falling(sExitMA2))
						TRAILtickAdjustLONG++;
					// Rule#6  Filter UPslope > EMA3 UPslope 
					if(	iTrailUseK2EMA3r6 == 1	
                                                                                                && Rising(sTrailUKF) && sTrailUKF[0] > sTrailMA3[0]	
                                                                                                && Rising(sTrailMA3) )
						TRAILtickAdjustLONG++;
					// Rule#7  EXITing KFilter is in a DOWNslope
					if(            iTrailUseUKFr7 == 1 && Falling(sExitUKF)) 
						TRAILtickAdjustLONG++;  
					//
						tVars.cStopLossTicks -= TRAILtickAdjustLONG;
//
		// this is what I tried to substitute into the code line 'SetStopLoss( )' with horrible results
			//	if ( Lows[1][0] <=  (Position.AvgPrice - tVars.cStopLossTicks * vTickMult))
			//		ExitLongLimit( (Position.AvgPrice - tVars.cStopLossTicks * vTickMult) + 3*TickSize);
					
			SetStopLoss(CalculationMode.Ticks, tVars.cStopLossTicks * vTickMult + 3*TickSize);															
			DrawSquare(CurrentBar.ToString() + "sl", true, 0, Position.AvgPrice - tVars.cStopLossTicks * TickSize * vTickMult, Color.Crimson);
				}			
			}
Any suggestions on how this can be coded effectively? My guess is that this may apply to several people that use SetStopLoss.

TIA!
Jon

update: swapped out
 
Code
 if ( Lows[1][0]
for
 
Code
  if ( Low[0]
and looks more normal but still looking for ideas
more update: I started another thread on MIT / LIT ... I feel that the question posed in this thread will be in the same context as the other discussion

Writing to you from the wonderful province of Ontario, Canada. Home to the world's biggest natural negative ion generator, the Niagara Falls, and to those that dare to know how to go over it in a barrel. SALUTE!
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,600




Sorry I am not following, maybe someone else will

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 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