Message Boxes from wrong time frames

Created at 14 Sep 2020, 18:28
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CT

ctid2568413

Joined 14.09.2020

Message Boxes from wrong time frames
14 Sep 2020, 18:28


Hi,

 

I am using Windows Forms to alert me when the certain market criteria are met.

The indicator is attached to multiple symbols and time frames.

The problem is that besides the correct alerts, I keep receiving alerts from time frames that I shouldn't receive at random times.

 

For example, there are on bar criteria on a daily time frame. I am getting a correct alert after the daily bar is closed but I also might get an alert a few hours later from 30 minute time frame, where the indicator is not attached. I must deal with lots of random alerts at a time.

 

I use multiple cTrader brokers and sometimes I run multiple instances of a single broker platform.

 

What might be a reason for that?

 

P.S. The message box is displayed asynchronously with System.Threading.Tasks.


@ctid2568413
Replies

firemyst
15 Sep 2020, 07:07

Are you sending up the alert based on Symbol and not Symbol/Timeframe combination?

 


@firemyst

PanagiotisCharalampous
15 Sep 2020, 08:27

Hi ctid2568413,

There is probably a bug in your code. To help you further, you need to share the indicator code and provide us with exact steps to reproduce this issue.

Best Regards,

Panagiotis 

Join us on Telegram 

 


@PanagiotisCharalampous

ctid2568413
15 Sep 2020, 12:55

@firemyst, this might be what I am missing. Which part of the code is it to be defined?

 

@PanagiotisCharalampous, possibly the above will solve it.


@ctid2568413

firemyst
15 Sep 2020, 13:27

RE:

ctid2568413 said:

@firemyst, this might be what I am missing. Which part of the code is it to be defined?

 

@PanagiotisCharalampous, possibly the above will solve it.

I can't tell where because I don't have your code, but you should do it wherever you check the conditions.

For example:

//check the symbol and time frame are the same as what's on the current chart this indicator is attached to.

if (Bars.TimeFrame == Chart.TimeFrame && Symbol.Name == Bars.SymbolName)
{
    //You know both the symbol and timeframe match, so this is where you do what you need to.
}
else
{
    //this is some other symbol name / timeframe combo
}

 


@firemyst

ctid2568413
15 Sep 2020, 14:01

@firemyst, thank you. I will see if this works for me or I will get back with the code.


@ctid2568413