Topics
13 May 2023, 06:02
 876
 6
03 May 2023, 00:03
 1366
 11
23 Feb 2023, 15:57
 782
 2
29 Jul 2022, 10:44
 831
 2
20 Jun 2022, 19:02
 1153
 5
19 Jun 2022, 21:47
 1331
 10
16 Jun 2022, 18:59
 923
 3
10 Nov 2021, 11:27
 0
 2078
 9
30 Oct 2021, 09:05
 1359
 2
Replies

m4trader4
22 Sep 2021, 12:56

RE: RE: RE:

 

When your order #2 is cancelled then how it gets filled again? I didn't got it at all.

You can use order label/comment or a boolean flag to avoid executing your code on PendingOrders_Cancelled event handler when you cancel your other orders.

For Order#2 which is not filled, PendingOrders_Cancelled is called and in that ExecuteMarketRangeOrder is executed using the parameters passed by PendingOrders.Cancelled event. 

Orders "label/Comment" will not be unique, or to have a unique identifier.  Let me know your suggestion of unique identifier.

There should be a intermittent order state :  Executed - Cancelled, Not Executed - Cancelled

 

 

 


@m4trader4

m4trader4
20 Sep 2021, 19:21

RE:

volkov.alexandro said:

I found very useful Sample Trading Panel going with cTrader installation.

I can change my Algo params sending them by clicking a button on panel. That works well - no need to restart cbot to change params

Would be nice if I could display on same panel some important data changing by timer (like unrealised profit/loss, winning/loosing pips).

I can pass that data to open panel but cannot make changes visible. I suppose some method of updating should be applied to panel (like Refresh or Update in Windows.Forms).

Couldn't find such method. Is it possible to refresh panel? Is there some other solution?

Thanks

Suggestion Use OnTick()

On every tick the data is refereshed


@m4trader4

m4trader4
20 Sep 2021, 19:06

RE:

amusleh said:

Hi,

The PendingOrders.Cancelled event will be called whenever a pending order is canceled, and that's how it should work.

I didn't understand your point on its not correct to call the Cancelled event when trader cancels the order, why?

If trader manually or a cBot via automate API cancels a pending order the Cancelled event will be triggered and the reason would be PendingOrderCancellationReason.Cancelled.

If the order had an expiry time and it got expired the Cancelled event will be triggered and the reason would be PendingOrderCancellationReason.Expired.

If the order got rejected before getting filled then the Cancelled event will be triggered and the reason would be PendingOrderCancellationReason.Rejected.

You can use the reason property to filter the event and only execute your code is the reasons is expired or rejected.

Hi

Case Scenario: Current Market price = 9.0

Cbot or Manually 5 pending orders are placed

Order#1 10.00 with StopLimitPriceRange  of  00.00 - 00.40 

Order#2 15.00 with StopLimitPriceRange  of  00.00 - 00.40

Order#3 20.00 with StopLimitPriceRange  of  00.00 - 00.40

Order#4 25.00 with StopLimitPriceRange  of  00.00 - 00.40

Order#1 is filled @ 10.10 

Order#2 is not filled @ 15.00 So the PendingOrders_Cancelled called, then the ExecuteMarketRangeOrder is executed and Order#2 is filled.

After Order#2, Cbot or Manually cancel other orders #3, #4, #5 PendingOrders_Cancelled is called and ExecuteMarketRangeOrder is executed possibly may get filled. which should not happen. And Cbot cannot be stopped as there are other function are being executed.

So Need details of the executed pending orders details, with these captured details ExecuteMarketRangeOrder orders are placed and executed or any other logic.

 

 


@m4trader4

m4trader4
19 Sep 2021, 15:52

Not just 500 or 1000 it should be "####.### " custom pips


@m4trader4