Replies

ctid1074959
21 Jan 2021, 16:02

heliodorstar - Could I get your help with this?

I need help track all manually entered positions so I can can close each individually using cTrader Automate as they hit defined variables i.e. profitTarget = +X or lossTarget = -X

Would you solution below work for this?

Would you mind sharing a simple bot that uses this approach?

I could pay via Venmo

Thanks,

-DE  

 

heliodorstar said:

Thanks very much for your answer, Panagiotis!

I decided to follow through your advice and first created a dictionary of type <string, List<Position>>.

After that I looped through all open positions and added them to the above dictionary using the pair name as a key.

Then I cycled the keys of the dictionary and did my calculations for every single pair and closed all suitable positions using:

Parallel.ForEach(
	dict_pos[pair],  // #dict_pos being my pair positions dictionary
	pos => close_pos_async(pos)
	);

where #close_pos_async is simply:

private void close_pos_async(Position pos)
	{
        ///<summary>Performs asynchronous close of a position.</summary>

		ClosePositionAsync(pos);
    }

 

 


@ctid1074959

ctid1074959
23 Sep 2020, 18:42

RE: RE: RE:

ctid1074959 said:

ctid1074959 said:

PanagiotisCharalampous said:

Hi ctid1074959,

You can post it here. If you don't want to disclose the code, you can send it to community@spotware.com

Best Regards,

Panagiotis 

Join us on Telegram

Thank you. I sent the code and info as directed.

I exported the trades to review and compare... it seems the longer time period changes the trade execution somehow showing different prices for the same trades and therefore a difference in comparable profit

-de

Hopefully you can figure this out and fix this quickly... otherwise using backtest is NOT accurate and NOT reliable.

Thanks again for taking a look... I'm excited to hear your findings.

--de

 

I see out of 245 trades 12 were executed differently (i.e. at a different price than it's counterpart) when comparing same trades of two different lengths of backtest; that's almost 5% of trades executed differently... so probably as the number of trades grows the impact increases to profit/loss calculations


@ctid1074959

ctid1074959
23 Sep 2020, 18:34

RE: RE:

ctid1074959 said:

PanagiotisCharalampous said:

Hi ctid1074959,

You can post it here. If you don't want to disclose the code, you can send it to community@spotware.com

Best Regards,

Panagiotis 

Join us on Telegram

Thank you. I sent the code and info as directed.

I exported the trades to review and compare... it seems the longer time period changes the trade execution somehow showing different prices for the same trades and therefore a difference in comparable profit

-de

Hopefully you can figure this out and fix this quickly... otherwise using backtest is NOT accurate and NOT reliable.

Thanks again for taking a look... I'm excited to hear your findings.

--de


@ctid1074959

ctid1074959
23 Sep 2020, 18:30

RE:

PanagiotisCharalampous said:

Hi ctid1074959,

You can post it here. If you don't want to disclose the code, you can send it to community@spotware.com

Best Regards,

Panagiotis 

Join us on Telegram

Thank you. I sent the code and info as directed.

I exported the trades to review and compare... it seems the longer time period changes the trade execution somehow showing different prices for the same trades and therefore a difference in comparable profit

-de


@ctid1074959

ctid1074959
23 Sep 2020, 14:18

RE:

PanagiotisCharalampous said:

Hi ctid1074959,

as mentioned above, I have a variable called :"absolutehigh" for highest profit point for time period... the "absoluteHIgh" for the shorter time period is higher (25k) vs the onger time period of (17k)... this should NOT be

No, you did not provide this information in the original post. To help you further with this, you need to provide us with the complete cBot code and steps to reproduce this behavior e.g. cBot parameters or any other information we need to know.

Best Regards,

Panagiotis 

Join us on Telegram

what email do I send to?


@ctid1074959

ctid1074959
23 Sep 2020, 13:53

RE:

PanagiotisCharalampous said:

Hi there,

Why do you expect to see the same results on different dates?

Best Regards,

Panagiotis 

Join us on Telegram

 

obviously I don't expect the same END resulting profit/loss

as mentioned above, I have a variable called :"absolutehigh" for highest profit point for time period... the "absoluteHIgh" for the shorter time period is higher (25k) vs the longer time period of (17k)... this should NOT be

what I do expect is the same trades for the same time periods 

ie

if I run 01/01/20 to 11/09/20 compared to 01/01/20 to 18/09/20 the trades for both runs between 01/01/20 to 11/09/20 should be the same trades

currently they are NOT.... different trades (during the exact same period) are triggering just by moving the end date of the backtest to a later date

understand?


@ctid1074959

ctid1074959
19 Mar 2019, 17:15

RE:

I dont want to post my code and parameters publicly... can i email private and get private response?

 

Panagiotis Charalampous said:

Hi ctid1074959,,

Thanks for posting in our forum. Can you please post the cBot code as well as the parameters and backtesting settins so that we can reproduce the problem?

Best Regards,

Panagiotis

 


@ctid1074959