Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

creating Indicator DataSeries with the values ​​of MFE

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

    creating Indicator DataSeries with the values ​​of MFE

    i want to create an indicator with DataSeries that contains the values of MFE. in this way tells me error. How can I do?

    #region Variables
    private DataSeries MFEDataSeries;
    #endregion

    protected override void Initialize ()
    {

    MFEDataSeries = new DataSeries (this);

    CalculateOnBarClose = true;
    Overlay = false;
    }

    protected override void OnBarUpdate ()
    {


    double mfe = Performance.AllTrades.TradesPerformance.Currency.A vgMfe / / ERROR

    MFEDataSeries.Set(Math.Abs(mfe));


    AvgR.Set (SMA (MFEDataSeries, Period) [0]);
    }

    Ciao.
    Roberto

    #2
    Hello Italy,

    That is because Performance is an object of a Strategy Class not the Indicator Class. You may view the following link that goes over the Performance object from our Help Guide.

    http://www.ninjatrader.com/support/h...erformance.htm

    If you would like to plot the trade performance of a Strategy then you can plot inside a Strategy. Note that the Strategy will only have access to the Trade performance of itself at run time, meaning that the trade performance that you access will only have the current trade performance of the strategy in that instance. The following thread has a reference sample that goes over how to plot withing a Strategy that you may view.
    http://www.ninjatrader.com/support/f...ead.php?t=6651

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hello Josh,
      I already use my strategies MFE values​​. I do not see them on the chart, I do not care!
      I would like, if possible, to construct an indicator with values ​​of MFE. Is there a command to get the value of MFE (maximum favorable excursion) ?
      Ciao.
      Roberto

      Comment


        #4
        Hello Italy,

        There is no command to get the AvgMfe (average maximum favorable excursion) from within an Indicator.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Christopher_R, Today, 12:29 AM
        0 responses
        4 views
        0 likes
        Last Post Christopher_R  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,234 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        1 view
        0 likes
        Last Post thread
        by thread
         
        Started by jclose, Yesterday, 09:37 PM
        0 responses
        7 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,414 views
        0 likes
        Last Post Traderontheroad  
        Working...
        X