PDA

View Full Version : NTAvgEntryPrice(NinjaAccount)


ATI user
08-05-2006, 09:47 AM
I am running efs ATIon the NT simulator using NT Playback, which has been working perfectly for months. I am now trying to retrieve the fill price for ANY order using NTAvgEntryPrice().

To do this I am entering and exiting positions on various bars in my chart and printing NTAvgFillPrice() below EVERY bar in the chart. This always prints 0, whether I am in a trade or not. In other words, whether I am in a trade or not I can not get the function to return a value.

Suggestions?

NinjaTrader_Ray
08-07-2006, 03:41 AM
Can you take a look at the NTSample file? Use that as a benchmark since it will plot out the information. Then make changes step by step to get to the desired result that you are looking for. Somewhere you are missing something but I don't have any idea what that could be which is why I always suggest starting with something that works and make changes in small steps.

Ray

ATI user
08-08-2006, 01:50 AM
I loaded NTSample.efs into a blank chart of russell emini with NTPlayback.efs running. Started TickReplay. DOM showed correct action but no Buy took place. Debug output therefore was all zeros.

NinjaTrader_Ray
08-08-2006, 02:30 AM
Can you run it on a live feed?

ATI user
08-08-2006, 02:33 AM
Running now live feed....still all 0s

ATI user
08-08-2006, 02:51 AM
I added a line to NTSample.efs in the else line (ie. if buy made/or not made)

drawText("long", BelowBar2);

This prints "long" below each bar...however, only when chart is refreshed....ie. not for current bar...this is strange....it should print on every bar

Of course, I should have had a buy and then the debug data on every bar also.....

NinjaTrader_Ray
08-08-2006, 04:46 AM
Not sure how that functions works, bestcheck with eSignal.

ATI user
08-09-2006, 04:03 AM
It would appear the problem was symbol mapping rather than the .dll file.

For some reason, ES U6 maps from eSignal to NT as ES2 09-06 without a problem and therefore NTSample.efs works fine for the ES. If you change the symbol in the chart to AB U6, you get all zeros (OR it shows some of the previous values for ES U6 if you ran the chart first on ES).

I added the function snippet provided in an earlier post as follows:

// symbol mapping workaround....
function getMySymbol()
{
vTicker= getSymbol();
if (vTicker== "AB U6")
vTicker= "ER2 09-06";
return vTicker;
}

Then change the code in all the relevant functions from getSymbol() to getMySymbol() andit works fine. Every time you Reload NTSample.efs, it buys another lot and updates the debug info.

Suggest NT might add the above functionand function changes to NTSample.efs; or document that NTSample.efs will only work for ES. Need to change above function code for dates of course.

I am curious to know why NTSample.efs only worksAS ISfor the ES, since ES is not referenced anywhere in the code. Anybody?

ATI user
08-10-2006, 12:00 AM
Even better...work $PLAYBACK into symbol mapfor using eSignal Tick Replay mode as follows:

// symbol mapping workaround....
function getMySymbol()
{
vTicker= getSymbol();
if (vTicker== "AB U6")
vTicker= "ER2 09-06";
if (vTicker== "$PLAYBACK")
vTicker= "ER2 09-06";

return vTicker;
}

This assumes you want to trade/test using the Russell 09-06 contract of course.