New cAlgo Order Entry

Created at 12 Feb 2015, 23:17
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!
DO

Dogtrader

Joined 05.11.2014

New cAlgo Order Entry
12 Feb 2015, 23:17


Hello, I received the notice that cAlgo order entry is now in lots (0.00). My robot programmer tells me "the cAlgo API doesn't allow fractional volume" ... integers only". 


@Dogtrader
Replies

AlexanderRC
12 Feb 2015, 23:23

Point him at VolumeToQuantity() and QuantityToVolume() methods.


@AlexanderRC

Dogtrader
13 Feb 2015, 11:08

Could you be more specific ... all we can find is this: 

Execute a Market Order

Syntax

public TradeResult ExecuteMarketOrder(TradeType tradeType, Symbol symbol, long volume, string label, double? stopLossPips, double? takeProfitPips, double? marketRangePips, string comment)

Parameters

NameDescription

tradeTypeDirection of Trade

symbolSymbol of Trade

volumeVolume of Trade

labelRepresenting label

stopLossPipsStop loss in pips

takeProfitPipsTake profit in pips

marketRangePipsmarket range (slippage) pips

commentorder comment

According this description the ExecuteMarketOrder() method takes volume as long type (long is integer type). This method doesn't take double (floating point value). I can only recalculate lots to volume by contract size or account balance. 


@Dogtrader

AlexanderRC
13 Feb 2015, 16:42 ( Updated at: 21 Dec 2023, 09:20 )

RE:

Dogtrader said:

 

According this description the ExecuteMarketOrder() method takes volume as long type (long is integer type). This method doesn't take double (floating point value). I can only recalculate lots to volume by contract size or account balance. 

Yes that is exactly that, you need to recalculate "Quantity" in lots (lots are different per instrument) into "Volume".

These are newly added functions to do the recalculation. Screenshot from built-in cAlgo help.


@AlexanderRC

usynn
07 Apr 2015, 17:22 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

In my cTrader, there is no definition for the method Symbol.QuantityToVolume. If you check the API for the interface, the method also isn't listed. What's the workaround for this?

Thanks

AlexanderRC said:

Dogtrader said:

 

According this description the ExecuteMarketOrder() method takes volume as long type (long is integer type). This method doesn't take double (floating point value). I can only recalculate lots to volume by contract size or account balance. 

Yes that is exactly that, you need to recalculate "Quantity" in lots (lots are different per instrument) into "Volume".

These are newly added functions to do the recalculation. Screenshot from built-in cAlgo help.

 


@usynn

Spotware
09 Apr 2015, 17:16

In my cTrader, there is no definition for the method Symbol.QuantityToVolume. If you check the API for the interface, the method also isn't listed. What's the workaround for this?

Thanks

Unfortunately, there is no workaround. You need to wait until your cAlgo will be updated to new version.


@Spotware

JohnTaylorHK
05 May 2015, 09:45

RE:

Spotware said:

In my cTrader, there is no definition for the method Symbol.QuantityToVolume. If you check the API for the interface, the method also isn't listed. What's the workaround for this?

Thanks

Unfortunately, there is no workaround. You need to wait until your cAlgo will be updated to new version.

I believe it was mooted that SpotWare would move to using lots throughout. There are just new functions to convert between currency units and lot sizes.  Symbol.QuantityToVolume and the reverse function are included in the copy of cAlgo I downloaded yesterday. Best Regards, John


@JohnTaylorHK