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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          54 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          72 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X