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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          80 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          63 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          63 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          54 views
          0 likes
          Last Post CarlTrading  
          Working...
          X