Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custum indicator to a new Strategy doesn't work

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

    Custum indicator to a new Strategy doesn't work

    Hello,

    i'm looking for a short answer. I will have some difficulties to explain my problem because i'm french, so sorry

    i create an indicateur based on Renko and it working great. I integrated at the end different print to know if my indicator works. It was good
    At the end , i create 2 indications : ConditionsValue and renkoPeriodvalue.

    This different tool will serve in my strategy that's why i finished in my indicator by :

    " // Ajoutez une méthode pour récupérer la valeur de la variable depuis l'extérieur si nécessaire
    public int GetConditionsValue()
    {
    return conditionsValue;
    }

    public double GetRenkoPeriodValue()
    {
    return renkoPeriodValue;
    } "

    I create a strategy that will take position from conditionsValue. (If conditionvalue = 1 ,buy and vice versa). To see on picture.

    I have something via output for conditionvalue and renkoPeriodValue from my indicator (named is : conditionsValuesTest5 and RenkoPeriodValue Test5) but not from my stratégy and i don't know why... ...


    I tried with my friend ChatGPT but nothing works (first time i create an indicator, i spent a lot of time, and i wanted to automate all of that ..)

    If you can help me , it will be really sympatical ☺





    #2
    Hello Biboun,

    As this is not a series, OnBarUpdate() is going to automatically update. If the method or values are being set in OnBarUpdate(), you will need to call Update() first.


    Are you just trying to make a variable set from OnBarUpdate() public?

    Below is a link to an example of this. See lines 41, 97, and 117 through 121.



    From our experience at this time, ChatGpt is not quite adequate to generate valid compilable NinjaScripts that function as the user has intentioned. We often find that the generated code will call non-existent properties and methods, use improper classes or inheritance, and may have incorrect logic. We highly encourage that you create a new NinjaScript yourself using the NinjaScript Editor, and use the code generated by ChatGpt as more as suggestions and guide than the actual code generated.

    Below is a link to a forum thread that discusses ChatGpt and it's limitations.
    https://forum.ninjatrader.com/forum/...pt-code-editor
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you about your answer.

      I will try

      As you indicate , i(m trying to take a variable from OnBarUpdate (in my indicator) to use in my strategy.
      The name's variable is conditionValue...

      I will see , thank you ​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      41 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X