Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Building a click trader, need to resolve compiling errors
Collapse
X
-
Building a click trader, need to resolve compiling errors
I'm getting the errors in the following snapshot. How do I resolve these? Thanks.
Tags: None
-
Hello inthemoney,
Thanks for your post.
On line 14, you need to change 'public class MyStrategy : NinjaTrader.NinjaScript.Strategies' to 'public class MyStrategy : Strategy' to resolve the error.
This could be seen by opening a New > Strategy Builder window to create a new NinjaScript strategy, clicking the 'View code' button on the Strategy Builder, and noting the same code section to see how it is programmed.
See this screenshot demonstrating the above: https://brandonh-ninjatrader.tinytak...MF8yMDY2MjYzOQ
The compile errors for MouseButton and MouseEvent indicate there is a missing assembly reference for these items. To resolve the compile errors you would need to add the appropriate reference assembly to the script to access those values. Note that detecting mouse button clicks is not NinjaScript specific so we do not have NinjaScript help guide documentation on this and it would go beyond the support we are able to provide.
To find more information about using these C# items, you could do a Google search for something like 'C# MouseButton'. When I Google search for this the first search result I see gives us MSDN documentation for how to reference and use this item in C#.
See this publicly available MSDN page: https://learn.microsoft.com/en-us/do...w=windowsdeskt op-7.0
This reference sample could be viewed to see how to add custom buttons in a NinjaScript using WPF modification: https://ninjatrader.com/support/help...ui)-modifi.htm
You could view this script from the Ecosystem User App Share demonstrates how you could program custom buttons in a NinjaScript to place orders when clicked: https://ninjatraderecosystem.com/use...bar-buttons-2/
Let me know if I may assist further.
The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
52 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
43 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
48 views
0 likes
|
Last Post
|

Comment