Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting Tradingview to Ninjascript, can someone help me?

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

    #31
    Ok. Just making sure that the logic itself was fine. As long as the logic matches what you are intending for it, and that is all a part of your strategy, then it should be alright. From there, you just need to double check the code to make sure it works as intended, then keep testing it in various situations to ensure the code is still doing everything as intended, and fix any bugs/ logic issues that come up. Was there anything else that you are having issues with?

    Comment


      #32
      Can you add the part about swing breakouts to my code?

      Comment


        #33
        That would have been from post #26 if I remember correctly.

        The part about breakouts is this part in particular:
        swingHigh is set earlier in the code and if the LongTrade is still valid, it will enter once price has reached or has broken that particular level.

        if (LongTradeIsValid && Close[0] >= swingHigh)
        {
        EnterLong();
        //LongTradeIsValid = false;
        }​

        Also, I noticed in when you originally posted your code that you have it set to Calculation.OnBarClose. I would change it to OnPriceChange or OnEachTick, if you haven't already done so. If you have it set to OnBarClose, OnBarUpdate won't update again until the close of the bar, so it won't enter at the break of the level, it will enter on the close only if the close is higher than the swingHigh..In most cases, it will slip past the point you wanted to enter unnecessarily.
        Last edited by rockmanx00; 02-18-2025, 07:17 PM.

        Comment


          #34
          Ok thank i will try it

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by SiebertCowen, Yesterday, 11:58 PM
          0 responses
          3 views
          0 likes
          Last Post SiebertCowen  
          Started by hunghnguyen2016, Yesterday, 08:00 PM
          0 responses
          8 views
          0 likes
          Last Post hunghnguyen2016  
          Started by cbentrikin, Yesterday, 03:49 PM
          0 responses
          11 views
          0 likes
          Last Post cbentrikin  
          Started by MiCe1999, 04-14-2025, 06:54 PM
          7 responses
          77 views
          0 likes
          Last Post b.j.d
          by b.j.d
           
          Started by NISNOS69, Yesterday, 02:20 PM
          0 responses
          18 views
          0 likes
          Last Post NISNOS69  
          Working...
          X