Replies

cAlgoBuddy
19 May 2021, 15:42

RE:

PanagiotisCharalampous said:

Hi cAlgoBuddy,

This happens because in the following case, the constructor method returns the same indicator.

            _diPlusFilter = Indicators.GetIndicator<MyDiPlus>(14);
            _diPlusFilter.Bars = Bars;
            _diPlusFilter.Init();

            _diPlusSignal = Indicators.GetIndicator<MyDiPlus>(14);
            _diPlusSignal.Bars = SignalBars;
            _diPlusSignal.Init();

_diPlusFilter and _diPlusSignal are references to the same object. To force the constructor to return a new object, create a dummy parameter and pass a differrert value every time e.g.

            _diPlusFilter = Indicators.GetIndicator<MyDiPlus>("Bars", 14);
            _diPlusFilter.Bars = Bars;
            _diPlusFilter.Init();

            _diPlusSignal = Indicators.GetIndicator<MyDiPlus>("Signal", 14);
            _diPlusSignal.Bars = SignalBars;
            _diPlusSignal.Init();

Hope this helps.

Best Regards,

Panagiotis 

Join us on Telegram

Many thanks, it works fine like this!


@cAlgoBuddy

cAlgoBuddy
13 Jan 2021, 09:24

RE:

PanagiotisCharalampous said:

Hi johnmadenis,

I did not understand what is the problem. Can you please explain?

Best Regards,

Panagiotis 

Join us on Telegram

Hello Panagiotis,

There is a difference on the position between the Events log and the History. For reference please look the 1st and 3rd attached pictures. (Pepperstone cTrader)

At the Events tab, the flow of events is correct. Position with ID3 is opened on 12 OCT, position with ID4 is opened on 17 OCT and position with ID5 is opened on 19 OCT.

The logical continuity of time is correct.

At the History tab, position with ID 3 is opened on 12 OCT, position with id 4 is shown to have been opened on 10 OCT (how is this even possible? to have a position opened in the past?) and position with ID 5 is opened on the 19 OCT.

The flow of time is not correct. Furthermore, in the events we can see that position 4 had a positive outcome (Take profit Hit, log entry 13), while in the positions tab the trade appears to have a huge loss.

The exact same behavior can be seen in pictures 2 and 4 (Spotware cTrader) with position with ID 6

I hope I explained everything better.


@cAlgoBuddy