Topics
Forum Topics not found
Replies
cAlgo_Fanatic
13 Aug 2013, 12:14
We have tested cAlgo on small virtual PCs (600 MB of memory) and it works well.
To improve performance further you may simply avoid building and/or creating extra instances of unnecessary robots.
@cAlgo_Fanatic
cAlgo_Fanatic
13 Aug 2013, 11:44
Thank you for the suggestion we will consider it for the future.
@cAlgo_Fanatic
cAlgo_Fanatic
13 Aug 2013, 09:21
You need to change the code in the foreach loop to this:
netProfit += openedPosition.NetProfit + openedPosition.Commissions;
@cAlgo_Fanatic
cAlgo_Fanatic
09 Aug 2013, 16:55
RE:
Mocean said:
Spotware - please elaborate?
That is correct, by setting your stop loss in relative value (pips away), you avoid the risk of the stop loss being invalid because it will be calculated as pips away from the entry price.
What you're saying here is that "relative value" SL will set the SL from the Entry Price, as opposed to a static SL value in the pending order. So a "relative vlue" SL will account for any Slippage on the Entry Price. How does this eliminate the SL from being inside the spread and rejected by your flawed programming?
Our plan is to:
- introduce what we call Relative Protection for Limit and Stop orders - the same way as we have it done for Market Orders - desired protection levels are defined by users in pips from the executed price which would give us the logical space not to validate
So why is it you can't use the "logical space not to validate" from the SL I set in the Pending Order?
The relative protection implementation will function as follows: In the event that the protection is within the spread the position will close.
So is cTrader a ECN / STP - or is it another Market Maker platform for Prime Brokers instead of Retail Brokers?
http://www.youtube.com/watch?v=9-_HweZUGS4
@cAlgo_Fanatic
cAlgo_Fanatic
09 Aug 2013, 15:37
RE: RE:
jallopy said:
Hi Admin,
Is this implemented yet, could you give and example code for closing , for example , 25% of an open position?
Thank-you
admin said:
There will be an implementation for it very soon.
This feature has not been implemented yet.
@cAlgo_Fanatic
cAlgo_Fanatic
09 Aug 2013, 15:28
If you could post the code snippet for the logic of positions being triggered that would be helpful.
Two things you should be aware of.
- The functions HasCrossedAbove/HasCrossedBelow compare the two series for the specified period. If the period is set to zero, then only the last values will be compared. Usually, the last values are not the final values and what you see on the chart will not be representing the values at the time that the HasCrossedAbove/HasCrossedBelow were triggered, The series may actually cross after the HasCrossedAbove/HasCrossedBelow methods were triggered.
It is not uncommon that the function will return true and by the end of the bar the two series will uncross. Try using the OnBar event with a period of at least one. This way the series will be compared for the last as well as the previous values. - The backtesting tick data are as close to the real data as possible but due to the fact that they are being calculated each time, they will be slightly different each time you do the backtest.
@cAlgo_Fanatic
cAlgo_Fanatic
09 Aug 2013, 11:59
RE: RE:
Hi cAlgo Fanatic,I saw this conversation and it works good, but due to the commission which will be applied after the close, final netProfit amount becomes less than what I set up.
So how can I solve this problem by applying the commission on the exit?
Thank you for your help in advance.
Please clarify your question. The net profit is equal to the gross profit minus the commission.
If you like to close the positions on the event that the robot stops you can add the code to the OnStop() method.
@cAlgo_Fanatic
cAlgo_Fanatic
08 Aug 2013, 17:53
This cannot be done at the moment but it will be considered for the future.
@cAlgo_Fanatic
cAlgo_Fanatic
08 Aug 2013, 14:33
They are stored on Spotware servers and are sent to the liquidity provider when the price reaches the order target price.
@cAlgo_Fanatic
cAlgo_Fanatic
08 Aug 2013, 11:31
We are investigating connection issues. We apologize for this inconvenience.
@cAlgo_Fanatic
cAlgo_Fanatic
08 Aug 2013, 10:46
Move Stop Loss to Break Even depends on commissions. Move to Break Even tries to set the stop loss so that your net profit will be 0 if it is triggered.
@cAlgo_Fanatic
cAlgo_Fanatic
07 Aug 2013, 09:59
RE:
iRobot said:
I want to reference to DEMA indicator in my robot, but I don't understand why I can't do that.
Indicator is working, I reference it in the robot, I declare it, but it's not recognized.
I know it is super simple question, but pls help someone.
Please follow these steps to add a reference of the indicator in the robot.
- Click the Add Reference button next to Build button in the text editor and
- Locate the indicator file from the cAlgo\Sources\Indicators folder. Make sure you build the indicator first.
- Declare the indicator
private DEMA demaIndicator;
- Initialize it
protected override void OnStart() { demaIndicator = Indicators.GetIndicator<DEMA>(DataSource, Period); }
- Now you can access the Indicator values in a method like OnBar or OnTick
protected override void OnBar() { double lastValue = demaIndicator.dema.LastValue; //... }
@cAlgo_Fanatic
cAlgo_Fanatic
06 Aug 2013, 11:40
RE:
Although I have another question in this issue: how can I index price channel values? Let's say I need to have its values for for 3 periods in the past = should I use indexing or "foreach"?
You can use either one. The foreach statement traverses the whole list so you would need to add a break statement to stop once it reaches the last element you want to check.
The for loop uses indexing and you can specify how many elements it will traverse.
See also this c# loops tutorial.
@cAlgo_Fanatic
cAlgo_Fanatic
06 Aug 2013, 11:33
RE:
Guys, sorry for stupid questions...
However, could you give suggestions on:
1) in a given robot, where to put other conditions for closing a profitable position (take profit, but not on specified pip size, but rather on conditions ment by other indicators);
2) how to make just one position opened at the time (now it opens new postions despite the number of curent positions).
Thank you very much.
1) The conditions may be in the OnTick event or in another method that is being called in the OnTick. See for instance the Sample Trend Robot in cAlgo.
2) Use a global field that is initialized in the OnPositionOpened event. There are examples in the samples included in cAlgo, e.g. Sample Trend Robot, Sample SAR Trailing Stop (the global field is "position").
@cAlgo_Fanatic
cAlgo_Fanatic
06 Aug 2013, 11:03
RE:
Hi Spotware,
will you clearify it a lttle more, please.
My opinion is if you place a stop loss and the market is when the stop loss is triggered, out of range.The platform should still take the stop loss as a fact and close the position immideately. This is bound to happened now and then in a fast moving market. A position without a stop loss can be devistated for the trading account. The purpose of placing it, is to protect the position and should do so under any circumstances. "Changing protection to relative values will allow us to remove such validation".
If that means that a change is coming to prevent a position with a stop loss, "not to be out of range", we are welcoming it.
Thanks..
That is correct, by setting your stop loss in relative value (pips away), you avoid the risk of the stop loss being invalid because it will be calculated as pips away from the entry price.
@cAlgo_Fanatic
cAlgo_Fanatic
06 Aug 2013, 09:31
RE:
can someone explain or tell me how ?
Using Chrome or Safari browser, navigate to the brokers page for cTrader Web. The spotware URL is ct.spotware.com.
@cAlgo_Fanatic
cAlgo_Fanatic
13 Aug 2013, 17:31
Can you please clarify what the intended logic is:
You are setting a new stop loss if the trade type is sell:
But if the type is Buy you are setting stop loss to entry price:
@cAlgo_Fanatic