Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Understanding MAE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Understanding MAE

    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
    Attached Files
    Last edited by shiva_mohan; 04-26-2011, 04:57 AM.

    #2
    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.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      Yup I already read that ... it is based on my understanding of that documentation ...

      MAE (max. adverse excursion) is defined as |worst price trade reached)
      that from my example, MAE in my mind should be 2.0 but actually is 4.0.

      That is why I wanted to clarify my understanding with the example posted.

      Thanks

      Comment


        #4
        Simple MAE Print to output

        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));
        }

        Comment


          #5
          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]);
          Please let me know if I can assit you any further.
          JoydeepNinjaTrader Customer Service

          Comment


            #6
            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

            Comment


              #7
              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
              }
              To assist you further please furnish a bit more details and either upload the code or send it to support[AT]ninjatrader[DOT]com if possible, giving the reference of this thread and Attn:Joydeep in the subject line.

              I look forward to assist you further.
              JoydeepNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by swestendorf, Today, 11:14 AM
              2 responses
              5 views
              0 likes
              Last Post NinjaTrader_Kimberly  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              4 responses
              13 views
              0 likes
              Last Post xiinteractive  
              Started by Mupulen, Today, 11:26 AM
              0 responses
              2 views
              0 likes
              Last Post Mupulen
              by Mupulen
               
              Started by Sparkyboy, Today, 10:57 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by TheMarlin801, 10-13-2020, 01:40 AM
              21 responses
              3,917 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Working...
              X