Is there a way to back test this strategy? The strategy computation now is giving me the open price of the next bar which may be quite different(gaps) from what I will experience in real time and therefore will not allow me to optimize the parameters for the indicator.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Changing Fill to Current Bar
Collapse
X
-
Changing Fill to Current Bar
I am using tick data to compute an indicator on the Open price of a bar. In real time I would then place a market order and it would fill on some price within the current bar hopefully.
Is there a way to back test this strategy? The strategy computation now is giving me the open price of the next bar which may be quite different(gaps) from what I will experience in real time and therefore will not allow me to optimize the parameters for the indicator.Tags: None
-
Ray,
In the help menu of 6.5 I find 'Fill Types':
Custom Fill Algorithms
In addition to the two system fill types (Default and Liberal) you can also script a custom fill algorithms using any code/text editor.
Would this give me the capability to change the way an order is filled so that I could fill it with a price from the current bar.
This code looks kind of difficult and the example is not complete. Is there more documentation for this functionality?
Comment
-
I don't recall if the current bar value is retrievable withing this class. If it is then yes however, we do not provide support for this which is of course why you do not see documentation. Which just expose it for those who can take advantage of this feature with out our help.RayNinjaTrader Customer Service
Comment
-
Ray,
Looking at the code in the @DefaultFillType.cs I am seeing NextHigh,NextLow,NextOpen defined as public variables from some other code that we do not have access to. Can you tell me if Open[0],High[0],Low[0] (CurrentBar Open,High,Low) are defined by some public variable that I can access? If so what would they be called.
Comment
-
Just as well!
I followed the procedure in Help:
1. Provide a new display name for example rename "Liberal" to "MyFill"
2. Provide a new class name for example rename "LiberalFillType" to "MyFillType"
3. Code your fill algorithm within the Fill() method
4. Once complete, open any indicator or strategy within the NinjaTrader's NinjaScript Editor and compile. This will compile the new fill algorithm and make it available within any backtest dialog window.
After compiling a strategy the Fill Type I had created did not show in the drop down list.
So what is described in Help does not work. I think!!!
Comment
-
No thanks to MS the file was saved as .cs.txt. Now that is corrected the procedure works but I can't find where I can reference the current bar H/L/O/C.
This would be of a great help in testing systems that reference tick data when you are displaying min bars.
Comment
-
Hi There,
Did you have any luck completing this custom fill? I am also working on the same issue. The place where I am running into an issue is in accessing Open, High, Low, Close from the Fill(Order order) method. NextOpen, NextHigh, and NextLow are all available, but I get the error "Close does not exist in the current context". Is this the same issue you rant into earlier?
Thanks,
Learning1
Comment
-
Dierk,
Thanks for making this change. Making OHLC available will greatly enhance the capability to simulate real trades. NinjaTrader is by far the most responsive trading package on the market today.
Now if you could only fix the problem with the BackBars being added to the length of the Walk Forward
(See http://www.ninjatrader-support.com/v...ead.php?t=6000)
we would have an exemplary way of doing system testing as it should be done.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by judysamnt7, 03-13-2023, 09:11 AM
|
4 responses
59 views
0 likes
|
Last Post
by DynamicTest
Today, 08:25 PM
|
||
Started by ScottWalsh, Today, 06:52 PM
|
4 responses
36 views
0 likes
|
Last Post
by ScottWalsh
Today, 07:40 PM
|
||
Started by olisav57, Today, 07:39 PM
|
0 responses
7 views
0 likes
|
Last Post
by olisav57
Today, 07:39 PM
|
||
Started by trilliantrader, Today, 03:01 PM
|
2 responses
21 views
0 likes
|
Last Post
by helpwanted
Today, 07:25 PM
|
||
Started by cre8able, Today, 07:24 PM
|
0 responses
10 views
0 likes
|
Last Post
by cre8able
Today, 07:24 PM
|
Comment