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 arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        61 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        48 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X