HOW!!?? Turn SetStopLoss into a ExitLongLimit - futures io
futures io futures trading



HOW!!?? Turn SetStopLoss into a ExitLongLimit


Discussion in NinjaTrader

Updated by Big Mike
    1. trending_up 2,106 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

HOW!!?? Turn SetStopLoss into a ExitLongLimit

(login for full post details)
  #1 (permalink)
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 received

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!
Reply With Quote

Can you help answer these questions
from other members on futures io?
Spoofing,Bluff Orders, Manipulation?
Emini and Emicro Index
ThinkScript: Dates and Times Training Session
ThinkOrSwim
Is DXY effected by futures transactions?
Traders Hideout
I have segregated my investment and trading
Psychology and Money Management
Attempt to Divide by 0 Error
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on futures io
VWAP for stock index futures trading?
35 thanks
What Is the Source of Your Edge??
23 thanks
VWAP oscillator for NT8
15 thanks
Index options vs futures options
11 thanks
Battlestations: Show us your trading desks!
10 thanks
 
(login for full post details)
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,057 since Jun 2009
Thanks: 31,658 given, 95,054 received




Sorry I am not following, maybe someone else will

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > HOW!!?? Turn SetStopLoss into a ExitLongLimit


March 26, 2011


Upcoming Webinars and Events
 

An Afternoon With futures io member TropicalTrader

Elite only
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts