Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Strategy does not load
Collapse
X
-
Hello lorenzoP,
If 'Include Commission' is set to True, then yes, any commissions setup would be included with the Net Profit.
-
Hello lorenzoP,
Thanks for your reply.
In the strategy analyzer, it would be, in your example 1000 units of whatever the per unit value is of the instrument.
Leave a comment:
-
ill do it, i have a general question:
does the strategy analyzer uses leverage? if i set 1000 as order size this mean that im open a position for example with 1000 euro, right?
Leave a comment:
-
Hello lorenzoP,
Thanks for your reply.
I was not aware of that, thank-you.
In that case, move the line AddChartIndicator(PriceBreakoutRectangularBase(upw ardBreakout,volumeMultiple)); to the state == state.Dataloaded section.
Leave a comment:
-
Hi, there is also an indicator, with the same name of the strategy, as said i have not change nothing about the original strategy (you can find it in the download section)
ill try changing the "current bur"
Leave a comment:
-
Hello lorenzoP,
Thanks for your posts.
In general, if you cannot load the strategy then you would want to observe the "log" tab of the control center as there may be errors in the loading process of the strategy that will show in the log but would not be something the compiler would be able to catch.
Taking a quick look at the first post attachment it looks like you are using AddChartIndicator(PriceBreakoutRectangularBase(upw ardBreakout,volumeMultiple)); The PriceBreakoutRectangularBase() is a strategy, not an indicator so it cannot be added to the chart like an indicator. AddChartIndicator() should only be used in State.DataLoaded.
Your second line of code in OnBarUpdate() is: if ((Close[1] > EMA1[1]) this line will generate a run time error that you would see in the Log tab. On the very first bar of data loaded the code is trying to look back one bar which does not yet exist. You would need to employ a check of the "CurrentBar" to ensure enough bars are loaded before trying to access them. Reference: http://ninjatrader.com/support/helpG...currentbar.htm
Later on, it appears you are accessing the index of [2] so you might want to use as the first line of code in OnBarUpdate() if (CurrentBar < 2) return; to prevent bar index access errors.
Commenting out (or removing) the AddChartIndicator in State = State.Configure and adding the CurrentBar check should allow your strategy to load/run.
Leave a comment:
-
here the the original one:
Leave a comment:
-
Strategy does not load
im trying to create a strategy mixing price breakout (a free strategy find here) and another one. i would like to use the same type of trail stop, but using different entry. so i copied the entry condition: and all other stuff like private ... and under propritie
it gives me no error but i cannot enable it
i have attached a txt with the codeAttached Files
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
25 views
0 likes
|
Last Post Today, 05:17 AM | ||
Started by MaupinFinche, Today, 05:08 AM
|
0 responses
2 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
||
Started by Enkidu, Yesterday, 06:40 AM
|
9 responses
35 views
0 likes
|
Last Post
by Enkidu
Yesterday, 01:11 PM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
12 responses
307 views
0 likes
|
Last Post
by z.franck
Today, 04:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
32 responses
268 views
0 likes
|
Last Post
by f.saeidi
Yesterday, 06:49 AM
|
Leave a comment: