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

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 needsomehelp147, 04-29-2024, 06:43 AM
      2 responses
      19 views
      0 likes
      Last Post needsomehelp147  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      177 responses
      2,400 views
      0 likes
      Last Post jeronymite  
      Started by algospoke, Today, 06:36 PM
      0 responses
      6 views
      0 likes
      Last Post algospoke  
      Started by ETFVoyageur, Yesterday, 06:05 PM
      8 responses
      53 views
      0 likes
      Last Post ETFVoyageur  
      Started by futtrader, 04-21-2024, 01:50 AM
      7 responses
      69 views
      0 likes
      Last Post NinjaTrader_Eduardo  
      Working...
      X