Topics
04 Jun 2015, 20:02
 3385
 7
13 Dec 2013, 07:40
 4457
 14
29 Nov 2013, 08:01
 3978
 3
28 Nov 2013, 02:02
 3507
 5
12 Nov 2013, 21:55
 2973
 2
30 Oct 2013, 06:16
 0
 3816
 4
29 Oct 2013, 07:34
 4115
 3
Replies

Hyperloop
05 Dec 2013, 20:24

RE:

Spotware said:

We've checked your code and got the following result:

05/12/2013 04:44:18.686 | Robot "TestOpenPosition" was started successfully for GBPUSD, m1.
05/12/2013 04:45:00.256 | Executing Market Order to Buy 10k GBPUSD (SL: 30, TP: 30, MR: 1)
05/12/2013 04:45:00.490 | → Executing Market Order to Buy 10k GBPUSD (SL: 30, TP: 30, MR: 1) SUCCEEDED, Position PID676961
05/12/2013 04:45:00.490 | Position opened. Label: Test. ID: 676961. Direction: Buy. Volume: 10000. Entry: 1.6351. T/P: 1.6381. S/L: 1.6321. Margin Level: 10396%.

 

For now we can not figure out the reason of the behavior you have.

It is working on your end?


@Hyperloop

Hyperloop
29 Nov 2013, 20:42

Great, I look forward to future updates.


@Hyperloop

Hyperloop
29 Nov 2013, 20:41

May I ask what the benefit of running multiple instances of cAlgo is compared to just having all robots under 1 instance?


@Hyperloop

Hyperloop
29 Nov 2013, 20:36

RE:

Spotware said:

The Stop() method will be triggered before the callback is. Therefore, the robot will stop before the callback is triggered. 
When using asynchronous methods, the callback is used to control execution when the result is received from the server. 

In asynchronous operation, when a request is send to the server, the program continues to execute the next statements, without waiting for the response from the server.  The statements that follow the trade operation request cannot assume anything about the result of those requests. 


You also need to change the type of the callback in your method to   Action

protected override void OnStart()
{
    OpenBuyLimitAsync("EURUSD", 10000, Symbol.Ask - 20 * Symbol.PipSize, "test1", null, null, null, "test", SendSMS);
    OpenBuyLimitAsync("EURUSD", 10000, Symbol.Ask - 20 * Symbol.PipSize, "test1", null, null, null, "test", PrintMsg);
    // Stop();
}

public void OpenBuyLimitAsync(string argSymbol, int argVolume, double argTargetPrice, string argLabel, 
    double? argStoplossInPips, double? argTakeprofitInPips, DateTime? argExpiration, string argComment, 
    Action argCallback)
{
    Symbol XXXYYY = MarketData.GetSymbol(argSymbol);
    PlaceLimitOrderAsync(TradeType.Buy, XXXYYY, argVolume, argTargetPrice, argLabel, 
        argStoplossInPips, argTakeprofitInPips, argExpiration, argComment, argCallback);
}

 

Perfect thank you. I tried that last night, but couldn't get it working but re-entered and it compiled fine. Thanks again :)


@Hyperloop

Hyperloop
29 Nov 2013, 20:28

That would be quite helpful for HFT/arb. traders. :)


@Hyperloop

Hyperloop
29 Nov 2013, 08:25

Hi,

Are there currently future plans to release additional events for both the Positions AND PendingOrders?

Ex) PendingOrders.Placed, PendingOrders.Cancelled, Positions.Modified, PendingOrders.Modified

Being able to detect global changes like these would be very helpful especially for who run multiple robots simultaneously.

PS. So far the new API is great; love it!


@Hyperloop

Hyperloop
29 Nov 2013, 04:00

Looking forward to this, will be nice to protect code for remote trading. :)


@Hyperloop

Hyperloop
28 Nov 2013, 22:16

There are sample robots when you download cAlgo, there is a robot that uses a custom indicator. You can just look at that.


@Hyperloop

Hyperloop
28 Nov 2013, 20:49

RE:

Spotware said:

You can use server latency but we cannot guarantee that it will remain so in the future. 

Sorry, what do you mean by this statement?


@Hyperloop

Hyperloop
28 Nov 2013, 01:17

I agree, profiles/workspaces on cAlgo/cTrader would be really helpful, especially when traders are using multiple instances of the platform simultaneously.


@Hyperloop

Hyperloop
27 Nov 2013, 21:47

I ended up fixing it by sacrificing the value for the current bar on MainSeries. It doesn't lose much as the current bar is still open and the value changes anyways and I trade mainly OnBar.

Revised code:

public override void Calculate(int index)
        {
            int MainIndex = GetIndexByDate(MarketSeries.OpenTime[index]);
 
            double NetChange = MainSeries.Close[MainIndex - 1] - MainSeries.Open[MainIndex - Lookback];
 
            Result[index] = NetChange * 10000;
        }
 

 


@Hyperloop

Hyperloop
27 Nov 2013, 21:40

Yes, I just updated my entire library of methods today to take advantage of all the new API features. :)


@Hyperloop

Hyperloop
27 Nov 2013, 21:13

Slippage in double means you can set it to a fraction of pips. Ex) 2.1 pips, 1.0 pips, etc.


@Hyperloop

Hyperloop
27 Nov 2013, 08:45

The reference price you mentioned is the current market price (bid for short, ask for long).

As for your second question, cAlgo recognizes the difference between pips and points (unlike some of its competitors). With that said, 1 = 1 pip.


@Hyperloop

Hyperloop
27 Nov 2013, 06:07

You can use the new API for partial closes now.

ClosePosition(position, position.Volume/2);

 


@Hyperloop

Hyperloop
26 Nov 2013, 21:45

/algos/robots/show/341

Is this what you're looking for?


@Hyperloop

Hyperloop
25 Nov 2013, 23:03

Do you have an ETA on tick data testing?


@Hyperloop

Hyperloop
25 Nov 2013, 23:02

Am I correct in saying that the proxy is for stability, whereas the actual order routing, and price feeds is still dependent on the server latency?


@Hyperloop

Hyperloop
25 Nov 2013, 04:14 ( Updated at: 23 Jan 2024, 13:15 )

RE: RE:

facestockvn said:

cAlgo_Fanatic said:

Please see this sample for a custom RSI indicator: [/forum/calgo-reference-samples/655]

and for Stochastics:  [/forum/calgo-reference-samples/657]

Can you Integrate RSI with Stochastic in one indicator?

You can code that into a custom indicator very easily within cAlgo. :)


@Hyperloop

Hyperloop
22 Nov 2013, 00:20

I think your best bet right now is just wait for the release of Spotware Connect. That should allow more flexbility.


@Hyperloop