when i check for the last trade tick by tick can you confirm that they are the same?
if not why they are different?
Another thing is : when i run in market replay of historical i'm able to open and close position.
when i run it in the strategy analyzer i cannot, do i have to be connected to what?
I'm connected to my continuum account when running the analyzer but i don't get any trade even though in playback it would've traded a lot.
(If i run MA strategy it works), but not even the initial print work.
In the analyzer can i access file in my pc like i do for the playback or not? (StreamReader ecc)
What i did in orde to make thing clearer is:
else if (State == State.Configure)
{
AddDataSeries(Instrument.FullName, Data.BarsPeriodType.Tick, 1);
}
so i get the series
and then what i do to access that data serie is :
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.Last && BarsInProgress == 1)
{
bla bla
}
}
i thought that by doing this i'm gonna run all like if it was tick by tick and by putting the principal graph to 1 minutes i would've been able to visualize bar at 1 minute but do the calculation at 1 tick.
This is not the case because if i put everything at 1 tick it runs really slow of course, if i put principal at 1 day and the series added at 1 tick then the backtest goes really fast.
about the analyzer i'm going to put some part of the code that may be helpful to answer my questions:
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Strategy here.";
Name = "Download Data 2";
Calculate = Calculate.OnEachTick;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.ImmediatelySubmit;
TimeInForce = TimeInForce.Gtc;
TraceOrders = true;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 20;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
orderbook = new OrderBook();
buckets = new List<Bucket>();
hawkes = new Hawkes(0.5, 1.1, 0.5, 50); // alpha beta mu
vwap = new VWAPCalculator(100);
hint = new Hint();
}
protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.Last && BarsInProgress == 1)
{
Print(e.Time.TimeOfDay);
string side = "";
if (e.Price >= e.Ask)
{
side = "B";
}
else if (e.Price <= e.Bid)
{
side = "S";
}
HERE I HAVE MY LOGIC OF THE STRATEGY AND I JUST DO :
IF(I HAVE TO ENTER):
SetProfitTarget(CalculationMode.Ticks, 25);
SetStopLoss(CalculationMode.Ticks, 10);
if (sign == 1) EnterLong();
else EnterShort();
}
this works perfectly in playback. it doesn't in the analyzer
thanks

Comment