Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

i want an indicator that will exactly replicate a strategy with particular structure.

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

    #16




    this was a really bad experience.



    this is a perfectly valid question i made and repeated multiple times: one can create a strategy and an indicator for nt that are exactly identical, and then colors, alerts and any other actions on the indicator will have nothing to do with the entries and exits on the strategy.



    nt support was not of much help, it took me a long time, a lot of trial and error and also studying some c# to be able to figure this out by myself.



    i share the solution here for anyone else who could find this to be useful.




    one can have this strategy that i posted to this thread:


    if ((Position.MarketPosition != MarketPosition.Short)
    && (SMA1[0] < SMA1[1])
    && (Momentum1[0] < Moml1)
    && (ADX1[0] > Adxp))
    {
    EnterShort(Convert.ToInt32(Posi), @"sp01");
    }


    else


    // Set 4
    if ((Position.MarketPosition == MarketPosition.Long)
    && (SMA1[0] < SMA1[1]))
    {
    ExitLong(Convert.ToInt32(Posi), @"elp01", @"lp01");
    }


    // Set 3
    if ((Position.MarketPosition != MarketPosition.Long)
    && (SMA1[0] > SMA1[1])
    && (Momentum1[0] > Moml2)
    && (ADX1[0] > Adxp))
    {
    EnterLong(Convert.ToInt32(Posi), @"lp01");
    }


    else


    // Set 2
    if ((Position.MarketPosition == MarketPosition.Short)
    && (SMA1[0] > SMA1[1]))
    {
    ExitShort(Convert.ToInt32(Posi), @"esp01", @"sp01");
    }



    an indicator with the exact same structure, components and inputs will have nothing to do with this strategy.

    Comment


      #17



      it is this structure that the indicator must have:



      if ( (SMA1[0] < SMA1[1])

      && (Momentum1[0] < Moml1)

      && (ADX1[0] > Adxp)) )

      {

      downtrend0barsago = true;

      uptrend0barsago = false;

      }

      else if ( (SMA1[0] < SMA1[1]) )

      {

      uptrend0barsago = false;

      }



      if ( (SMA1[0] > SMA1[1])

      && (Momentum1[0] > Moml2)

      && (ADX1[0] > Adxp) )

      {

      uptrend0barsago = true;

      downtrend0barsago = false;

      }

      else if ( (SMA1[0] > SMA1[1]) )

      {

      downtrend0barsago = false;

      }



      if ( (SMA1[1] < SMA1[2])

      && (Momentum1[1] < Moml1)

      && (ADX1[1] > Adxp)) )

      {

      downtrend1barsago = true;

      uptrend1barsago = false;

      }

      else if ( (SMA1[1] < SMA1[2]) )

      {

      uptrend1barsago = false;

      }



      if ( (SMA1[1] > SMA1[2])

      && (Momentum1[1] > Moml2)

      && (ADX1[1] > Adxp) )

      {

      uptrend1barsago = true;

      downtrend1barsago = false;

      }

      else if ( (SMA1[0] > SMA1[1]) )

      {

      downtrend1barsago = false;

      }



      if (downtrend0barsago == true)

      {

      PlotBrushes * downtrend color *

      }

      if (uptrend0barsago == true)

      {

      PlotBrushes * uptrend color *

      }

      if (downtrend0barsago == false && uptrend0barsago == false)

      {

      PlotBrushes * neutral color *

      }



      if (downtrend0barsago == true && downtrend1barsago == false)

      {

      * short entry events, alerts, emails, files, et cetera *

      }

      if (uptrend0barsago == true && uptrend1barsago == false)

      {

      * long entry events, alerts, emails, files, et cetera *

      }

      Comment


        #18
        MojoJojo give this a try teindicatortri.cs

        You can store the theoretical strategy position as a Series<int> so then you can also do your "check" for Position.MarketPosition

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        646 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        367 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X