Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The previous day's one-minute decision

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

    #31
    Hello ラリー,

    That is done from the script in your code. You can use the Print function to output data to the output window. You can review the following links to learn about using the output window and Print statements.







    Comment


      #32
      Thank you for your reply.


      The sample code in the second link you sent me (I think it says something like Print("This is a message")) outputs, but how do I get the output for the program I am currently creating?​

      Comment


        #33
        Hello ラリー,

        You can place print statements inside your own code. The help guide is showing how to use a print, you would need to edit your code to include prints if you wanted to output some value in your own script.

        Comment


          #34
          Thank you for your reply.

          Currently my script edit screen looks like this, "If you want to output values to your own script, you will need to edit the code to include the printed material." but how can I edit the code to include the printed material?
          Attached Files

          Comment


            #35
            Hello ラリー

            From the image you have some prints in OnBarUpdate. That is how you can add prints to your script. You can change what you are printing to whatever is relevant to help you better understand the script. If you wanted to print a value you would replace the code inside the ( and ) to output that instead.

            The help guide is just an example, all help guide examples expect that you will change it to suit your needs.

            Comment


              #36
              Thank you for your reply.

              I have replaced the code (currentDayValue) and output to the print log, but it seems that only the result of the calculation for the currentDayValue is output, but the calculation for the entire program (MyCustomIndicatorPrevioushigh) I wanted to print out the result of the entire program (MyCustomIndicatorPrevioushigh), so I replaced currentDayValue with MyCustomIndicatorPrevioushigh, but I replaced the operator '+' with 'string ' and cannot be applied to the operand of a method group. I get an error message that says '+' cannot be applied to 'string' and the operand of a method group.
              How can I do this?
              Attached Files

              Comment


                #37
                Hello


                I have replaced the code (currentDayValue) and output to the print log, but it seems that only the result of the calculation for the currentDayValue is output,
                Right, if that is what you put in the print that would be all that is output. You can configure the print to output whatever data you wanted to.

                but the calculation for the entire program (MyCustomIndicatorPrevioushigh) I wanted to print out the result of the entire program (MyCustomIndicatorPrevioushigh)
                MyCustomIndicatorPrevioushigh is the name of your script, that is not a variable you could print. The items you can print are what you see in OnBarUpdate.

                You would also need to move the prints to later in OnBarUpdate, the variables are being set after the print so the print will not show what values were set when OnBarUpdate is run.


                Comment


                  #38
                  Thank you for your reply.

                  Am I correct in understanding that if I specify Print(currentDayValue), then all the calculation results described after OnBarUpdate will be output to NinjaScript Output?

                  When the NinjaScript calculation results are applied to a chart, MyPlot2 in the data box shows a value of 0 at 14:50, but the output of NinjaScript Output shows -1, which is different from the results output to NinjaScript Output. Why is this different from the result output in NinjaScript Output?​
                  Attached Files

                  Comment


                    #39
                    Hello ラリー,

                    Am I correct in understanding that if I specify Print(currentDayValue), then all the calculation results described after OnBarUpdate will be output to NinjaScript Output?
                    Correct.

                    When the NinjaScript calculation results are applied to a chart, MyPlot2 in the data box shows a value of 0 at 14:50, but the output of NinjaScript Output shows -1, which is different from the results output to NinjaScript Output. Why is this different from the result output in NinjaScript Output?​
                    The data box shows the value where the mouse cursor is located or the current value when the mouse is not over the chart. The output window shows all prints in chronological order.

                    The reason this is 0 is because you have added a new conditions at line 69 and 74 which is resetting the value to 0, that was not part of the original sample that I had provided. The conditions checking for Close less than Open or Close greater than Open are where you would need time conditions if you wanted to limit that to a specific time. ​

                    Comment


                      #40
                      Thank you for your reply.

                      I changed the code once to the code you sent us in post 2 and changed it from print(currentDayValue ) to print(Value[0]) and the result applied to the chart and the result output to NinjaScript Output seemed to be the same, and the printing The printing problem seems to have been resolved (attached).

                      However, as for the session judgment, which was my first question, I have tried various methods, but they do not work, and the judgment is not based on the opening price at which the first trade started, and I am not sure if I understand it correctly or not.
                      I would appreciate it if you could share the code in a ZIP file (including all the code) if possible, as I do not understand it well and I apologize for any inconvenience.​
                      Attached Files

                      Comment


                        #41
                        Hello ラリー,

                        However, as for the session judgment, which was my first question, I have tried various methods, but they do not work,
                        We have covered the attempts that you tried, most of the changes you made were not correct so that changes how the basic example that I provided works. For what you are asking you need to add time conditions where the -1 or 1 are being set. Our support cannot create code for you but we can provide basic examples like we had already,

                        After you reverted the code the time conditions would need to be combined with lines 79 and 84.

                        Code:
                        if(Close[0] < Open[0] && timeConditionHere)
                        {
                           CurrentDayValue = -1;
                        }
                        else if(Close[0] > Open[0] && timeConditionHere)
                        {
                            CurrentDayValue = 1;
                        }

                        Comment


                          #42
                          Thank you for your reply.

                          I have changed NinjaScript as attached, is this correct?
                          Also, am I correct in understanding that the code from line 62 to 67 and from line 69 to 72 are required, and the code from line 79 to 87 is for determining whether the 1 minute leg is rising or falling?

                          I also got an error that timeConditionHere does not exist in the current context.​
                          Attached Files

                          Comment


                            #43
                            Hello ラリー,

                            It looks like you had copied the placeholder text rather than making your own time condition. In the last post I just pointed out where you need to place time conditions, I did not include any time conditions. You can see the following help guide link for examples of how to make a time condition.


                            Comment


                              #44
                              Thank you for your reply.

                              I was aware that I was supposed to copy the code from post 41, but I see that is not the case.​

                              ​If so, the code description in post 41, if(Close[0] < Open[0] &&timeConditionHere), does it mean that we replace the time condition with timeConditionHere here?
                              ​​

                              Comment


                                #45
                                Hello ラリー,

                                Yes you would need to make your own code, that is just showing where the time condition would go. You can see the help guide for examples of time conditions.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                668 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                377 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                110 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                575 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                580 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X