value form server different on m1 backtesting with the same code execution

Created at 30 Nov 2016, 03:44
CE

cedric.boudreau

Joined 02.03.2016

value form server different on m1 backtesting with the same code execution
30 Nov 2016, 03:44


Hi i have a big probleme with backtesting m1 data received and analysed.

 

i am using  in section1 : ontick , with m1 triger to lauch a sub macro.

On that sub macro i write on excel all m1bar open value,  section 2)

 

All data are writed on excel . but when i am activate this command   ModifyPosition(position, newStopLoss, null); a get exemple 18000 ligne but if i cancel it i got 37000 ligne like new value M1 are added . 

-Why that apphen ? New value from what.? and why there different ?

I cretate a manually stop loss and i got 37000 line ,

-so how the ModifyPosition can remove thousand of m1 triger ? this is very serious probleme. needs helps on that

 

1)    

      on ticks

            currentIndexMinute1 = seriesMinute1.Open.Count - 1;

            if (currentIndexMinute1 > lastIndexMinute1)
            {
                OnBarMinute1(currentIndexMinute1);
                lastIndexMinute1 = currentIndexMinute1
            }

2)                   ModifyPosition(position, newStopLoss, null);          Probleme from there

                        timestr = Server.Time.ToString("yyyy-MM-dd HH:mm:ss.fff");
                        var  sa = new System.Collections.Generic.List<string>();
                        sa.Add(timestr);
                        sa.Add(Symbol.Bid.ToString("F6"));
                        sa.Add(newStopLoss.ToString("F6"));
                        sa.Add(position.Id.ToString("F6"));
                        sout = string.Join(";", sa);
                        fwriter.WriteLine(sout);
                         fwriter.Flush(); 


@cedric.boudreau