Topics
20 Feb 2014, 14:35
 5
 1139
 1
03 May 2013, 15:50
 3432
 5
Replies

RaphBok
29 May 2013, 20:34

RE:
cAlgo_Fanatic said:

It is unclear what you need. If you use this property:

protected bool LongOnly
{
    get { return Mode == 0; }
}

To identify if the input is set for long only signals, then you would use an if statement somewhere in the OnTick() method:

if(LongOnly)
{
   //...
}



That did the trick! Thank you.


@RaphBok

RaphBok
29 May 2013, 05:55

RE: RE:
RaphBok said:
Hmm... okay, well that solved the error message (says, "Build Succeeded" now), but its not working as it should. I made a property for each scenario ("LongOnly", and "ShortOnly"), and placed it in the properties section of the code right after "Current bar index", and also tried to "call the property" (if that's even possible, or correct?) using the code below, but I think that is where the problem is. Does it have to be "initialized"? Anyway, can you PLEASE reformat the cBot, and paste full code here? I'm confuuuused, and will never figure it out on my own =| THANKS!

         protected int Shorts
        {
            get { return Mode - 1; }
        }

Any updates on this request? I would greatly appreciate it. LAST time I bug you guys for code - I promise! ;c)


@RaphBok

RaphBok
27 May 2013, 16:06

RE:
cAlgo_Fanatic said:

Well, the syntax for the property is correct, even though a little redundant. It will just return the value of Mode.

You could write a property like this instead:

        protected bool LongOnly
        {
            get { return Mode == 0; }
        }

 

 

 

Hmm... okay, well that solved the error message (says, "Build Succeeded" now), but its not working as it should. I made a property for each scenario ("LongOnly", and "ShortOnly"), and placed it in the properties section of the code right after "Current bar index", and also tried to "call the property" (if that's even possible, or correct?) using the code below, but I think that is where the problem is. Does it have to be "initialized"? Anyway, can you PLEASE reformat the cBot, and paste full code here? I'm confuuuused, and will never figure it out on my own =| THANKS!

         protected int Shorts
        {
            get { return Mode - 1; }
        }


@RaphBok

RaphBok
24 May 2013, 22:10

RE:
cAlgo_Fanatic said:

You can use an integer (int) Value 0 for Long and 1 for Short for example and set the Min/Max Values.

        [Parameter("0-Buy, 1-Sell", DefaultValue = 0, MinValue = 0, MaxValue = 1)]
        public int Mode { get; set; }



 

Thanks for the code, but I did sort of arrive at a similar workaround for the drop down box. The main issue I was having was "querying the attribute" (hopefully I'm using the terminology in correctly, lol) later on in the code. For example, the cBot skips all short selling signals, and only enters and exits long positions. I'm trying something like this in the properties section of the code:

protected int LongShortOnly
{
            get { return Mode; }

}


@RaphBok

RaphBok
24 May 2013, 12:13

RE:
cAlgo_Fanatic said:

Hello,

The cBot has been uploaded here: /algos/robots/show/271

Hi again. Can you please give me a parameter mod for this code that allows the user to choose between "long-only", "short-only", and "default (both)" types of positions using a drop down box (left panel section where currency pairs are added as an instance). I have only been able to partly figure out how to code this... I think =(


@RaphBok

RaphBok
20 May 2013, 21:10

RE:
cAlgo_Fanatic said:

It is by definition of risking a percent of your balance. If you only risk a certain percentage of your balance then you need to set stop loss. Otherwise you are risking 100%.

Oh, I see. That makes sense, lol. Thanks.


@RaphBok

RaphBok
18 May 2013, 08:45

RE:
cAlgo_Fanatic said:

We will upload a robot for you based on your description in the Robots section.

Before we do this we need you to clarify your definition of Risk: "The cBot risk 1% of account balance to go long/short the equivelent amount of currency (NO stop loss orders are used in this "system"). 

You cannot have a risk 1% of account balance without stop loss or stop out. 

Hey, I have a question about the "...cannot have a risk 1%... without stop loss..." part... is it because of margin requirements (I assume), or because it cannot be coded in cAlgo - or perhaps, both? Thanks!


@RaphBok

RaphBok
17 May 2013, 21:56

RE:
cAlgo_Fanatic said:

Hello,

The cBot has been uploaded here: /algos/robots/show/271

Great! Thank you so much guys! I appreciate it =)


@RaphBok

RaphBok
17 May 2013, 08:59

Any updates on the cBot guys?


@RaphBok

RaphBok
10 May 2013, 15:07

RE:
cAlgo_Fanatic said:

We will upload a robot for you based on your description in the Robots section.

Before we do this we need you to clarify your definition of Risk: "The cBot risk 1% of account balance to go long/short the equivelent amount of currency (NO stop loss orders are used in this "system"). "

You cannot have a risk 1% of account balance without stop loss or stop out. 

Wow, this is GREAT news! =c) Thanks guys! This will really help me learn the cAlgo API as I have a very beginner level knowlege of C# anyway.

About the stop loss issue... I would prefer the cBot to auto set the stop loss 15 pips away from the fill price (so however many lots it would take to equal 1% of account balance). Also, a dropdown box in the left side panel that allows for the changing of stop loss size, and initial % risk size would be appreciated. Again, any useful annotations in the code would be much appreciated as well!

 

 


@RaphBok

RaphBok
04 May 2013, 14:44

RE: RE:
Scott said:

http://www.scyware.com/ can be used for robots with multiple timeframes 

Thanks for the info guys.


@RaphBok