![]() |
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Nov 2010
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I don't think I'm properly understanding MAE. Could you please shed some light to this scenario: I have a stop loss that is 2 points away from my entry. My stop gets hit so the profit on the trade is -2 points. However, the MAE on the trade is recorded as 4 points? Should the MAE not be 2 points? Here is the image of the trade in question. The rectangle highlights the long entered at 1329 and stopped out at 1327. Cheers
Last edited by shiva_mohan; 04-26-2011 at 04:57 AM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Hi shiva_mohan, please see those definitions here - http://www.ninjatrader.com/support/h...efinitions.htm
It would take the worst price traded - which is the low of the bar in your case, not the stop value - so the MAE is higher than your loss here.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Nov 2010
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Bertrand,
Yup I already read that ... it is based on my understanding of that documentation ... Quote:
That is why I wanted to clarify my understanding with the example posted. Thanks |
|
|
|
|
|
|
#4 |
|
Member
Join Date: Nov 2008
Posts: 72
Thanks: 9
Thanked 0 times in 0 posts
|
What code can you add to simply print the highest price reached by the market during the time that a short trade was open? Help apprciated.
if (Position.MarketPosition == MarketPosition.Flat && PriorDayOHLC().PriorOpen[0] < PriorDayOHLC().PriorClose[0] && (CurrentDayOHL().CurrentOpen[0] - PriorDayOHLC().PriorClose[0]) > 1.5 && CurrentDayOHL().CurrentOpen[0] > PriorDayOHLC().PriorClose[0] && CurrentDayOHL().CurrentOpen[0] <= PriorDayOHLC().PriorHigh[0] && Bars.FirstBarOfSession) { EnterShort(DefaultQuantity, "U Short"); } { SetStopLoss("U Short", CalculationMode.Ticks, CurrentDayOHLC().CurrentOpen[0]+25) , false); SetProfitTarget ("U Short", CalculationMode.Ticks,((PriorDayOHLC().PriorClose[0]) - 25)); } |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello everington_f,
Thanks for your post. To get the Higest price since entry please use this code: Code:
Print(MAX(High, BarsSinceEntry() + 1)[0]);
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Member
Join Date: Nov 2008
Posts: 72
Thanks: 9
Thanked 0 times in 0 posts
|
Ok I get multiple lines in the output window for each day.... there should be only one output value per day, as this strategy trades once every session. Should this code be inserted after OnExecution?
Regards and thx |
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello everington_f,
Its difficult to say for sure unless I know what exactly you are trying to do. If you have put the code in OnExecution and getting multiple prints then most probably the orders are part-filled. In such scenario please filter the same by the following code: Code:
protected override void OnExecution(IExecution execution)
{
if (execution.Order.OrderState == OrderState.Filled)
{
Print(MAX(High, BarsSinceEntry() + 1)[0]);
}
//do rest of the stuff
}
I look forward to assist you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Understanding MASlopePlot | cmspruill | Indicator Development | 1 | 03-26-2011 10:53 AM |
| Help understanding logic | lookOutBelow | General Programming | 3 | 03-09-2011 01:43 PM |
| Help with SYMBOLS, am I understanding these..... | mdsvtr | Miscellaneous Support | 7 | 12-02-2010 04:17 AM |
| Understanding BuySellPressure | Crumbs | Charting | 1 | 01-28-2010 11:38 AM |
| Understanding Bars | The Kid | Strategy Development | 4 | 11-18-2008 06:04 AM |