Error buy Order Code

Created at 20 Oct 2021, 00:16
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!
EM

emmasystems

Joined 08.12.2015

Error buy Order Code
20 Oct 2021, 00:16


Please , i need to compare candles before placing a pending limitOrder sell.  Ihave used the code below:

if (MarketSeries.High.Last(0) > (MarketSeries.High.Last(1) &&PendingOrder > 4(distance){ PlaceBuylimitOrder} .

Not sure if this how to code 'BuylimitOrder in cTrader cbot.


@emmasystems
Replies

amusleh
20 Oct 2021, 07:43

Hi,

Please make clear what you want to do?

You should use Bars instead of MarketSeries.

You can find code examples on how to use Bars here: cAlgo API Reference - Bars Interface (ctrader.com)


@amusleh

emmasystems
20 Oct 2021, 12:36

RE:

amusleh said:

Hi,

Please make clear what you want to do?

You should use Bars instead of MarketSeries.

You can find code examples on how to use Bars here: cAlgo API Reference - Bars Interface (ctrader.com)

if(if (Bars.HighPrices.Last(0) > (MarketSeries.High.Last(1) &&PendingOrder > 4(distance){ PlaceBuylimitOrder} .)

Not sure if above is correct for a 'BuylimitOrder set after compaing distance and bar highlow in cTrader cbot.


@emmasystems

amusleh
21 Oct 2021, 09:37

RE: RE:

emmasystems said:

amusleh said:

Hi,

Please make clear what you want to do?

You should use Bars instead of MarketSeries.

You can find code examples on how to use Bars here: cAlgo API Reference - Bars Interface (ctrader.com)

if(if (Bars.HighPrices.Last(0) > (MarketSeries.High.Last(1) &&PendingOrder > 4(distance){ PlaceBuylimitOrder} .)

Not sure if above is correct for a 'BuylimitOrder set after compaing distance and bar highlow in cTrader cbot.

Hi,

What you want to compare? your code is not valid C# code.

When you post code use the editor post code option and select C# from languages list.


@amusleh

emmasystems
27 Oct 2021, 11:26

do while Series

Hello Support , 

Please for Time Series as in comparing minutes of Server Time. 

does cTrader have the equivalence as ....

startMins=0; endMinutes =0; 

do bb_x

{

( bb_ xminutes >= 0) 

bb_x = Server.Time.Min> bb_xminutes;

}

 

 

 

 


@emmasystems