Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Converting Tradingview to Ninjascript, can someone help me?
Collapse
X
-
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?
-
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
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by SiebertCowen, Yesterday, 11:58 PM
|
0 responses
3 views
0 likes
|
Last Post
![]()
by SiebertCowen
Yesterday, 11:58 PM
|
||
Started by hunghnguyen2016, Yesterday, 08:00 PM
|
0 responses
8 views
0 likes
|
Last Post
![]() |
||
Started by cbentrikin, Yesterday, 03:49 PM
|
0 responses
11 views
0 likes
|
Last Post
![]()
by cbentrikin
Yesterday, 03:49 PM
|
||
Started by MiCe1999, 04-14-2025, 06:54 PM
|
7 responses
77 views
0 likes
|
Last Post
![]()
by b.j.d
Yesterday, 03:45 PM
|
||
Started by NISNOS69, Yesterday, 02:20 PM
|
0 responses
18 views
0 likes
|
Last Post
![]()
by NISNOS69
Yesterday, 02:20 PM
|
Comment