Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
To draw only today not historic lookback; Builder
Collapse
X
-
Tags: None
-
Hello trdninstyle,
Thank you for your post.
When is Today_Only set to false? The only logic shown here is that Draw.Rectangle is called when Today_Only is true. If there is no logic to change Today_Only to false, Today_Only will always be true.
If you don't want the strategy to process on historical data, a simple solution would be to unlock the script and add the following to the top of OnBarUpdate:
if (State == State.Historical) return;
-
Hello Gaby,
I have the same script unlocked and one in the builder so I can go back & forth. I want to have the ability to select 'Today Only' and then not today only but my full lookback.
So, I should have Today Only as false then? In the Inputs. Or as false in the Variables? Bool.
Comment
-
" I want to have the ability to select 'Today Only' and then not today only but my full lookback."
I'm not sure what you are saying here - can you provide more details? What do you mean by "not today only but my full lookback"?
"So, I should have Today Only as false then? In the Inputs. Or as false in the Variables? Bool."
The conditions should have the ability to flip the bool between true and false. If you aren't explicitly stating in the logic of code when the bool should be true/false then the value of the bool isn't going to change. Meaning if you set the default value of Today_Only to true and have no logic to set it to false, it will always stay true and vice versa.
Comment
-
"The conditions should have the ability to flip the bool between true and false."
Yes, thats what I'm attempting to do.
I need to explicitly state for the logic of my code to be true or false, apparently I'm not doing that.
Here's a bar counter with the true false option for today only then if left unchecked it counts bars as far back as the lookback.
I'm sorry if I'm not understanding right now which is very basic to anyone else. If I could locate someone demonstrating this condition on u-tube I'll get it.
Comment
-
Comment
-
I'm going to try that then, but what are the steps to OnlyPlotToday in the builder ? I'm going to express it that way, sounds better.
Comment
-
I pasted in items from that bar counter script, here's the screenshots. If you really feel like helping me that would be awesome.
I had errors but I worked through them it compiles at this point but will not load.
Comment
-
The PlotIndy items I had all in there but it errored I removed them & it compiled, Somehow I need to place those back. ??
Comment
-
Comment
-
Hi Gaby,
Yes, it was from adding my own strategy to the chart, I removed the PlotTodayOnly items & that fixed it.
I'm going to over the weekend take that BarCounterThree, make a copy then start removing various parts compiling it along the way, until I have mostly the PlotTodayOnly left then begin to add one piece at a time from my other script into it. Essentially build my script into that one, because I can't bring 'plot today only' into it on the front end, I''ll go the back way. Try at least.
Last edited by trdninstyle; 11-05-2024, 07:25 AM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
602 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
559 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment