Topics
Replies
                     Hyperloop
                     13 Nov 2013, 22:48
                                    
RE: So, rebuild for cAlgo?
Jeex, if you're interested, you and I can code the algorithm together. I agree that the original code has "too much" and a lot of it can be cut down.
At the same time, I currently work with institutional price feeds. My spreads typically range between 0.0-1.0 pips plus a commission. It may something that can help in the performance of this model.
Let me know if you're interested.
@Hyperloop
                     Hyperloop
                     12 Nov 2013, 22:29
                                    
RE: tested and not happy
jeex said:
Tested the EA in a live account and was not happy. The beautiful straight line up in backtesting is almost the same in a live account, except now its going straight down. Too much slippage and volatility within a bar, that is not considered during backtesting. This EA needs optimal conditions to make money.
That's unfortunate. Would it be viable perhaps running it on a higher timeframe?
@Hyperloop
                     Hyperloop
                     12 Nov 2013, 22:12
                                    
No idea why this works, but I simply placed the line below in PublishTweet and it ran with no problems.
Console.WriteLine("Tweet has{0}been published", t.Publish(argToken) ? " " : " not ");
public static void PublishTweet(IToken argToken, string argTweet)
        {
            ITweet t = new Tweet(argTweet);
            Console.WriteLine("Tweet has{0}been published", t.Publish(argToken) ? " " : " not ");
        }
@Hyperloop
                     Hyperloop
                     11 Nov 2013, 22:14
                                    
Yes I understand you could do that. I don't think that would serve its purpose in this code.
@Hyperloop
                     Hyperloop
                     09 Nov 2013, 01:02
                                    
I will have time in about 3-4 days and I can probably code this up at that point if you would like?
@Hyperloop
                     Hyperloop
                     01 Nov 2013, 22:23
                                    
You can always make a cBot to do this. :)
private void SetTrailingStop(int argPositionID, int argTrailingStopPips, int argMinimumProfitPips)
        {
            foreach (var position in Account.Positions)
            {
                if (position.Id == argPositionID)
                {
                    if (position.Pips >= argMinimumProfitPips)
                    {
                        if (position.TradeType == TradeType.Buy)
                        {
                            Symbol XXXYYY = MarketData.GetSymbol(position.SymbolCode);
                            double NewStoploss = XXXYYY.Bid - (argTrailingStopPips * XXXYYY.PipSize);
                            if (position.StopLoss == null || NewStoploss > position.StopLoss)
                            {
                                Trade.ModifyPosition(position, NewStoploss, position.TakeProfit);
                                return;
                            }
                        }
                        else if (position.TradeType == TradeType.Sell)
                        {
                            Symbol YYYXXX = MarketData.GetSymbol(position.SymbolCode);
                            double NewStoploss = YYYXXX.Ask + (argTrailingStopPips * YYYXXX.PipSize);
                            if (position.StopLoss == null || NewStoploss < position.StopLoss)
                            {
                                Trade.ModifyPosition(position, NewStoploss, position.TakeProfit);
                                return;
                            }
                        }
                    }
                }
            }
        }
        private void SetBreakevenStop(int argPositionID, int argMinimumProfitPips)
        {
            foreach (var position in Account.Positions)
            {
                if (position.Id == argPositionID)
                {
                    if (position.Pips >= argMinimumProfitPips)
                    {
                        if (position.TradeType == TradeType.Buy)
                        {
                            if (position.StopLoss == null || position.StopLoss < position.EntryPrice)
                            {
                                Trade.ModifyPosition(position, position.EntryPrice, position.TakeProfit);
                                return;
                            }
                        }
                        else if (position.TradeType == TradeType.Sell)
                        {
                            if (position.StopLoss == null || position.StopLoss > position.EntryPrice)
                            {
                                Trade.ModifyPosition(position, position.EntryPrice, position.TakeProfit);
                                return;
                            }
                        }
                    }
                }
            }
        }
@Hyperloop
                     Hyperloop
                     01 Nov 2013, 22:19
                                    
RE:
Cerunnos said:
I am also of the opinion that there should exist only a few "miracle machines" that make constant profits over several years without changing the settings. My current live-robot has almost 30 parameters and because of the market dynamics I'll have to change the settings after a few months ..
If it's not too much to ask, how do you go about knowing when to change these settings? Not to mention to what?
@Hyperloop
                     Hyperloop
                     01 Nov 2013, 22:18
                                    
You're trading 1.0 standard lots with $1000 initial balance. I would say that's a little bit over-leverage.
In order to run something like this, you would definitely need leverage greater than 100:1. Floating loss must also be factored when it comes to managing your margin.
@Hyperloop
                     Hyperloop
                     30 Oct 2013, 21:37
                                    
RE:
Spotware said:
Pip Value will be added.
Do you have a rough time frame? I need to know so I can give my clients an ETA.
@Hyperloop
                     Hyperloop
                     30 Oct 2013, 20:07
                                    
Hi,
I just ran your code on the GBPCAD, and got the error:
"Crashed in OnStart with NullReferenceException: Object reference not set to an instance of an object."
@Hyperloop
                     Hyperloop
                     30 Oct 2013, 07:23
                                    
The bold didn't format correctly. Lines 34-38 is what I am talking about.
@Hyperloop
                     Hyperloop
                     30 Oct 2013, 01:00
                                    
string CurrencyOne = "CAD";
string CurrencyTwo = "USD";
try
{
	Symbol USDCAD = MarketData.GetSymbol(CurrencyOne + CurrencyTwo);
	Print("USDCAD {0}", USDCAD);
}
finally
{
	Symbol USDCAD = MarketData.GetSymbol(CurrencyTwo + CurrencyOne);
	Print("USDCAD {0}", USDCAD);
}
I am trying to make use of the try...finally block. Upon testing it, it seems like the finally block isn't executing. The above shows an example of what I am doing. Where am I going wrong?
Thanks. :)
@Hyperloop
                     Hyperloop
                     29 Oct 2013, 21:33
                                    
RE: Library of Trading Tools
BestFXBot said:
This article explains how import the cAlgo.API.dll in your project. - http://carbonfx.io/2013/08/using-visual-studio-with-calgo/
Once you make the necessary links, you can start building different tools for your projects and import these functions through
using CarbonFx.Utilities; // example
Thank you very much, I'll give it a shot. :)
@Hyperloop
                     Hyperloop
                     29 Oct 2013, 09:02
                                    
Thanks for the link! I just gave it a test and it actually worked. :)
The ability to communicate through different instances of cAlgo is still handy, I will take a look at the software you recommended.
Thanks again!
@Hyperloop
                     Hyperloop
                     28 Oct 2013, 22:58
                                    
RE:
Hyperloop said:
public void CloseBuyOrders(string argSymbolCode, string argLabel) { foreach (var position in Account.Positions) { if (position.Label == argLabel && position.TradeType == TradeType.Buy && position.SymbolCode == argSymbolCode) { Close(position); } } }When I try to compile this, I get the error "The name 'Close' does not exist in the current context".
I'm trying to create a library of common functions that I will use in future cBots.
Some help would be great! Thanks
Fixed it, was just a silly mistake.
Correction:
Trade.Close(position);
@Hyperloop
Hyperloop
14 Nov 2013, 22:44
/forum/cbot-support/1895
This is probably what you're looking for
@Hyperloop