Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Different Values for each Chart

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

    Different Values for each Chart

    Hello,

    i create a strategy, which i use for different Charts (NQ / ES / CL).

    I use int Profittarget / SL. Can i change the Values for a spezific Charts, like

    if Chart = "ES" then PF = 10
    if else Chart = "CL" then PF = xy?



    #2
    Hello Dirales,

    Yes you can do that, is this a manually coded strategy or are you using the builder?

    Comment


      #3
      Hello Jesse,

      i use a manually code:
      Code:
                      #region Resets ALL values when ALL positions are closed
                          if (Position.MarketPosition == MarketPosition.Flat && longEntry == null && shortEntry == null && longEntry2 == null && shortEntry2 == null && longEntry3 == null && shortEntry3 == null
                                  && targetLong == null && targetShort == null && targetLong2 == null && targetShort2 == null && targetLong3 == null && targetShort3 == null && Position.Quantity == 0)
                              {    
      //                            CurrentTriggerPrice    = 0;    CurrentStopPrice     = 0;    
                                  TrailStopBegin        = 16;    TrailFrequenz        = 1;    TrailStopDistanceMAX    = 22;    TrailStopDistance            = 16;
                                  EntryDistance        = 0;
                                  ProfitDistance1        = 22;     ProfitDistance2        = 26;    ProfitDistance3            = 32;
                                  StopDistance1        = 24;    StopDistance2        = 25;     StopDistance3            = 26;
                                  MaxOpenContract        = 5;
                                  closeopenorderafterxbar = 2;
                              }
                      #endregion​

      Comment


        #4
        Hello Dirales,

        You can do that kind of a within OnBarUpdate. Instead of using a UserInput you would use a standard variable:

        Code:
        private int pf = 10;
        protected override void OnBarUpdate()
        {
            if(Instrument.MasterInstrument.Name == "ES") pf = 12;


        Comment


          #5
          Hello Jesse,

          thats ( Instrument.MasterInstrument.Name ) exact what i search. Many Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          77 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          63 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          63 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X