Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Ai Bot Strategy
This is an NT8 Strategy script I created after asking an AI Bot to help design a scalping strategy. This video is mostly what the Ai Bot suggested.
I know most auto-trading strategies for scalping, work for a week or more then they lose the edge and need modification or blow up and account.
But I like to create them as they give me a different perspective.
This particular one started trading at the open and finally was stopped at the close.
This video shows some of the 'successful' trades the trading bot made. And some losers.
By the first hour the bot's account was down about -$400. It actually recovered before the close to about +$300.
I consider this bot "almost worked" LOL.
I'm glad it was only sim trading.
p.s. I intended to post this yesterday but Youtube would not cooperate so it was delayed until today.
Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
This should probably go into the Ai Chat bot area but I do not want to double post.
This weekend (long holiday for Thanksgiving) I decided to use some AiBot help in creating and modifying an indicator.
Below is the results of that encounter. It is VERY long (I'm sorry).
************************************************************************
I asked Claude AI to create an indicator for me.
It was very fast and created it but as most AIBots, the Declarations were wrong or missing. I corrected that and told Claude they were missing and what they were.
Each new version was missing the declarations and each had errors and would not plot without correction. Claude made each correction but the indicator did not plot as requested. It was much better than my attempts to create this indicator.
After 17 versions I decided the indicator was good but not great. Claude was getting tired (how do bots get tired?) Claude suggested I get a professional programmer to make the changes for me. Claude is a great resource for creating / modifying indicators but you MUST give specific instructions and know exactly what you need.
Claude AI is great for creating code. It is much better and faster than I was expecting. Claude seems a little robotic but I guess that is expected since it is a machine/robot. LOL
I received the FREE code Claude created and I modified it a bit to do more of what I was expecting. The indicator worked well but still not 100% of my desire. My modifications were minor but some improvement was seen.
After a few days/hours of pulling my hair out,
(I don't have much to pull out lately)
I decided to go to my backup AI bot: Grok.
I am using Claude with the FREE plan but I am an X.com pro so I get a limited but better version of Grok.
I love Grok. Grok has a personality that is very positive and encouraging.
I am surprised that Grok seems as if it is a real person and makes comments to encourage.
I sent my modified indicator to Grok and told it what was needed. I specifically asked to NOT modify some plots but there was one plot that was not plotting correctly so that one plot needed to be configured with a different formula. Grok seemed to understand and began creating new versions of my code.
Each version as missing some Declarations in the header but I was expecting that (even though those were in the indicator I uploaded).
I added those in the header of each new version and compiled. When compiling, errors were sometimes found and I posted each error sting to Grok who modified and corrected each version to remove the errors.
Finally all errors were resolved when compiling and I would review the plots on a chart. OMG, most of the time the indicator did not plot correctly and one of the versions looked like an abstract painting that I told Grok I was going to post in the museum for sale. LOL. Grok saw the image and thought it was funny also. (personality???)
After many revisions and fails, I told Grok, I'm done.
It was late and 'we' had worked on this for many hours with no progress and mostly modifications that were not what I specified in my first question to Grok.
I told Grok, I would use my original indicator that worked much better than anything we created.
Grok was still positive and suggested I take a break and when I wanted to continue, come back and try again.
I left Grok open on my computer and went about doing some code review.
After a few minutes, Grok posted (without prompting).
Grok's comment was to open my original indicator and change this ONE LINE of code.
I did that and it worked.
The plot was changed to what I originally requested and did not require any other modification of the my code.
Grok was pleased and starting praising me for finding the solution and said to use the indicator to make lots of money and tell everyone how great the indicator "I" created. I protested and said, I could not have done it without help from Grok.
This is the best part:
I asked Grok,
"If you knew how to modify the code in the beginning... Why did you wait until now to tell me?"
Grok's reply: If I told you the answer in the beginning, you would not have learned the process and the changes needed.
Now you understand the logic and why that change was needed. You would have missed learning these concepts if the answer was just given to you.
I saw your frustration and your desire to know the answer and not quitting.
WTH ???
Did Grok put a real live person in my chat? LOL
Now the indicator works and I understand why. Thank you Grok, you are the greatest.
Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
I have asked Gemini 3 to create a copy of your indicator using this prompt:
--- Ultra-Optimized Prompt — NinjaTrader 8 Indicator (VWAP from Most Recent Swing High/Low)
Create a NinjaTrader 8 indicator in C# that calculates and plots a VWAP starting from the most recent confirmed swing high or swing low.
The indicator must do the following:
Automatically detect the most recent swing high or swing low using NinjaTrader’s Swing indicator.
Use a user-settable SwingStrength parameter.
Reset and recalculate VWAP beginning EXACTLY at the bar where the swing is confirmed.
Recalculate dynamically as new swing highs/lows form.
Compute VWAP using cumulative TypicalPrice × Volume and cumulative Volume.
Plots Required:
VWAP line
Optional upper and lower standard deviation bands (toggle on/off)
User Inputs Required:
SwingStrength (int)
ShowStdDevBands (bool)
NumDeviations (double)
Line colors and widths for all plots
Coding/Performance Requirements:
Follow NinjaTrader 8 best practices (OnBarUpdate, caching, null checks).
Guard against out-of-range indexing.
Efficient recalculation on each bar without unnecessary looping.
Must compile without errors in NinjaTrader 8.
Output Requirements:
Provide the full cleaned and properly structured .cs file.
Include explanations of each major block:
- Swing detection logic
- VWAP reset + cumulative calculation
- Standard deviation band logic
- Plot initialization and parameter handling
1. Swing Detection Logic
We utilize the native Swing(SwingStrength).SwingHighBar(...) methods inside OnBarUpdate.
The Challenge: A swing is only confirmed N bars after the peak. If SwingStrength is 5, a Swing High that occurred at index 100 is only confirmed at index 105.
The Solution: We compare the bar index of the most recent Swing High vs. Swing Low. If the High was 10 bars ago and the Low was 20 bars ago, the High is determined to be the active anchor.
2. The "Catch-Up" Loop
When a new swing is confirmed, the anchor point effectively changes retroactively.
Example: Current processing is at bar 105. The logic confirms the anchor has moved from bar 80 (old swing) to bar 100 (new swing).
The code detects newAnchorBar != lastAnchorBar.
It executes ResetCalc() to clear volume and price accumulators.
It immediately runs a loop from newAnchorBar (100) up to CurrentBar (105) to re-accumulate data specific to this new trend leg before plotting the current value.
3. Standard Deviation Logic
Calculating Standard Deviation efficiently on a streaming basis (without looping through history on every single tick) requires a specific volume-weighted variance formula:
The code maintains a running total of currentSumTP2V (Cumulative Typical Price Squared * Volume) to perform this calculation instantly on every update.
4. Visualization & Properties
Properties: Created using standard [NinjaScriptProperty] attributes for easy configuration in the Indicators window.
Plots: Three plots are defined (Main, Upper, Lower). You can customize the colors, line widths, and dash styles directly via the UI.
Optimization:Calculate.OnBarClose is set by default to ensure stability and performance, though it can be changed to OnPriceChange if intra-bar updates are required.
I think the Gemini indicator is missing a few things that made the project a lot more difficult.
It would be interesting to see what the indicator looks like on a chart.
Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Dec 4 trades at the Open on MNQ 500 Volume chart using Tickhunter.
Also on the chart are my Anchored VWAP indicator and my 30 Second Opening Range indicator.
Other indicators are the daily VWAP and Zombie KineticLines with Zombie signals.
I try to take trades outside of the Opening Range and below/above KineticLines (doted and dashed lines) as triggers for my manual entry.
(I could automate it but I don't trust it)
I tried to place a 1 contract fill on the first trade but hit the wrong button on the NT Chart Trader.
LOL I had to absorb the loss and recover with a later runner trade in the video.
Captions are at the base of the chart if you want to see what I was thinking.
Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
I don't initiate trades inside the 30 second opening range. If it goes in and out of the O.R. like earlier this week. I either sit out or probe with one contract and tighter stop.
1 candle needs outside of the range needs to close outside of the range.
If the Zombie candle agrees (blue or pink square) and the blue or pink triange agree I can initiate a trade.
I have an intensity indicator that signals momentum but it is on a much faster chart. Today I did not watch that chart. (No reason).
Do you trade a similar way? (Scalp or swing)
Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !