Replies

deansi
03 Dec 2014, 17:34

Now that Ive researched it again, It was bugging me too so I figured it out, Not sure why spotware support didnt just mention this, instead of saying an exact SL is a limitation. The only limitation is the initial entering of the order, but modifying it gives you the option of any exact SL and TP you want

Alexanders example should do a good job.

A slight variant to that which works if you dont want to use the Async order and Async modify position types, and to add a bit more explanation below:

   double SLinPips = 3.7;
   double TPinPips = 5.5;
   ExecuteMarketOrder(TradeType.Sell, Symbol, vol, label, SLinPips, TPinPips, slip); // For a Sell Entry

            var pos1 = LastResult.Position;         //get most recent position
            if (pos1.TradeType == TradeType.Sell)   //make sure its the right direction, for SL TP direction to be right
            {  double SL = pos1.EntryPrice + SLinPips * Symbol.PipSize;  //get the positions actual entry price add SL
               double TP = pos1.EntryPrice - TPinPips * Symbol.PipSize;
               ModifyPosition(pos1, SL, TP);        // change the SL and TP
            }

So to explain what going on in this example the ExecuteMarketOrder will enter the order with the SL and TP but rounded to whole pips first, then when the order is filled it will continue on to the code below it, where the SL and TP are reinstated, but this time to the exact 3.7pips and 5.5pips.

You would obviously need another similar one below your buy trades with the appropriate logic of trade type and SL being below the entryprice and TP above etc

 


@deansi

deansi
02 Dec 2014, 03:40

zumzum another workaround thats possible to implement in a cbot is to have both the server set SL rounded up to nearest pip, and a cbot implemented SL that is the exact target SL you want that checks on every tick.

So you would set the server SL to a rounded up value of your target (eg real target SL is 3.5pips, set server to 4.0 pips) as backup safety, then you use an OnTick() method to keep checking if the market has reached or passed your real target SL of 3.5pips and close the trade the tick it finds the price has. The only thing you need is to have a price version of your stop loss for this on tick methed, not quantity of pips like the server way of setting the SL.

In addition this workaround requires that the computer and cbot are running and internet connectivity ok, in case of a problem your server set SL (in this example of 4.0pips) if hit, will only cost you 0.5pips more if your system wasnt connected for some reason or if the market volatility was too fast, all good reasons to have BOTH stop losses in place just in case.

If youre getting more slippage than expected due to the delay between your computer and the trade server, or you just want to be able to turn your computer off but the SL still hold up, you could put this system on a vps, for about £25 per month, or some brokers give you this service free if you have enough balance or volume turn over per month.

Let me know if you have trouble coding.

 


@deansi

deansi
11 Nov 2014, 16:16

Translated to english, Frank says something like:
"Hello, it would be nice if you could switch the chart between BID / ASK display chart, would be like Dukascopy . Especially with variable spreads . As it is right now , the customer can not control the way prices for short positions."


@deansi

deansi
10 Nov 2014, 01:39

Hi,

may be this is answered somewhere on these forums, but its very hard to find things since the ctdn search engine isnt great, I dont know which of the 200+ hits to look through [option to search 'Subject Field' would be useful!].

Anyway, MarketData.GetSeries how can I get tick bars in a cBot as are available on a chart. eg t1, t5, t10....?

Or do I have to make them with a function inside OnTick() ? This will make more cpu load off course if the function is not available in the cAlgo platform.

Thanks


@deansi

deansi
06 Nov 2014, 14:46

how trading anything works

your message to FxPro live chat you said 200ms execution,

I think you mean 2000ms (which is 2 seconds),

anyway in high volume times I have had delays due to liquidity like this happen and missed trades with other brokers like dukascopy (Ive never tried Fxpro), so you may start the learning process now, especially if youre trying to trade on news moves, youre friends trades got executed because he may have taken the last liquidity at that moment before you ...! lol

If there is 200k waiting at the prices you are willing to enter a  trade at, and you try for 200k, but someone else beats you by 1ms, you dont get the trade at that moment, and maybe never, a simple fact of any market


@deansi

deansi
05 Nov 2014, 13:32

Did you try the custom indicator someone made called DailyFxNews?
It can be set to show only news relevant to the pair you are on, or all news, but doesnt show the actual numeric result of the event.

can be downloaded at: /algos/indicators/show/431


@deansi

deansi
05 Nov 2014, 13:20

Agreed, some strategies need the real tick spread and price-timing accuracy.
Im used to having minimum 10 -12 years of bid and ask tick data to back test with, but for now I cant even


@deansi

deansi
05 Nov 2014, 13:12

or semi customisable time frames as found in jforex will do this.


@deansi

deansi
03 Nov 2014, 14:00

And seconds also: 1, 2, 3, 4, 5, 10, 20, 30...


@deansi

deansi
03 Nov 2014, 13:45 ( Updated at: 03 Nov 2014, 13:46 )

Yes ive got caught out with this too, and missed moving a SL and TP when they got hit.


@deansi

deansi
30 Oct 2014, 02:14

RE:

Hi,

Any update on this? would really like to see more accurate backtesting resulting from actual spread at the time of the ticks that cbot would have traded, like dukascopy platform does.

admin said:

Hello,

We are planning on providing the actual tick data (actual spread) in the future. The current backtesting setting options for the spread are Fixed value, Random spread and Current live spread as you can see in the screenshot below.


@deansi