Replies

banbeng
26 Nov 2012, 22:27

RE:
can I  get the FULL path of the api and libraries?
 
so I can try to upload them via c #

@banbeng

banbeng
21 Nov 2012, 12:11

if there are no developments...

 

can I have a code example of calgo in some other language like c #.net

always, if possible, only the skeleton with some event like onbar or onTick

 

or however an explanation if it is possible

thanks


@banbeng

banbeng
11 Nov 2012, 18:18

RE: Hi,
admin said:

If by MTF you mean multi time-frame EMA then i can tell you that this is something that we are currently working on.

Therefore, ability to write a multi-timeframe indicator will soon be possible.

 

if I want to create a program that works with timeframe 5 minutes and uses indicators such as moving average 1 day (pivot ect) ON THE SAME SYMBOL
can I do it?

@banbeng

banbeng
06 Nov 2012, 09:45

RE: RE:

i've been tuned but how long will i wait??

it is possible for us to know what are the new updates and when there will be??

 

thanks


@banbeng

banbeng
18 Oct 2012, 12:15

RE:
thanks both for  response that for advice on the code

Robot class creates conflicts when
call objects in my main?

I can then use the robot class to class without any problems?
I thought it was unique ability of the main class.

@banbeng

banbeng
16 Oct 2012, 22:25

(this is the code thet give me the error!)

 

in the if the true code are:

 

if(ln<cos){norm=ln;}
 if(ln==cos){norm=ln;}
if(ln>cos){norm=ln-1* pipsize;}

 

must be badly enter the code in the last reply


@banbeng

banbeng
16 Oct 2012, 22:18

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//    Please use the “Feedback” tab to provide us with your suggestions about cAlgo’s API.
//
// -------------------------------------------------------------------------------



using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;


namespace cAlgo.Robots
{
	
    public class Tool
    {
    	//public Position pos;
    	
    	//Info informazione=new Info();
    	int decimali=0;
    	
    	
    	public Tool(int decimalii)
    	{
    		this.decimali=decimalii;
    	
    	}
    	
    	 //arrotonda//
    	 //arrotonda//
    	public double round(int dir, double cos , double pipsize)
    	{
    		double norm,ln=0;
    		if(decimali!=-1){ ln=Math.Round(cos,decimali);}
    		else { Console.WriteLine("Error");}
    		if(dir==-1)
    		{
    			if(ln<cos){norm=ln;} if(ln="=cos){norm=ln;}">cos){norm=ln-1* pipsize;}
    		}
    		
    		if(dir==1)
    		{
    			if(ln<cos){norm=ln+1* pipsize;}="" if(ln="=cos){norm=ln;}">cos){norm=ln;}
    			//Trade.CreateSellStopOrder(Symbol,1000,Symbol.Bid,null,null,null);
    		}
    		return ln;
    	}
    	
    
    
    }
    
 }   
   

 


@banbeng

banbeng
16 Oct 2012, 01:09

RE:
admin said:

Hello,

 

In cAlgo you need to define each class in a separate file. Then you need to reference that file in the class which you want to use it. The filenames should be the same as the classes defined in them, i.e. class Imperial should be saved in filename Imperial.cs

e.g. 

//#reference: ..\Robots\Opertation.algo

using cAlgo.API;

namespace cAlgo.Robots
{
    public class Imperial : Robot
    {
        private Opertation robot;

        // etc.

    }
}

 

 

 

I placed the code
creating two new classes
which I compiled
and called up
 
/ / # reference: .. \ Robots \ HD.algo
/ / # reference: .. \ Robots \ Tool.algo
 
but one of them gave me a problem in compiling:
 
build succeeded
Unable to load assembly: assembly must contain single algo type
 
 

@banbeng

banbeng
14 Oct 2012, 20:39 ( Updated at: 23 Jan 2024, 13:11 )

 

" For modifying Pending Orders please visit: [/docs/reference/calgo/api/internals/itrade/modifypendingorder] "

 

I read the page but I can not understand how to change the price of entry for the pending order!

 

if i have bid at 1.2301

and a sell entry at 1.2290

 

how can i cange this entry to 1.2280??

can i use this syntax??

foreach( PendingOrders pos in Account.PendingOrders) //position sono attivi pendingorder passivi!
    		{
    			
    			if(pos.symbolcode==symbol && pos.TradeType=TradeType.Buy )
    			{
    				
    			       // API for pending modify
    				
    			}
    			
    			
    			
    		}

I hope I've been clear as much as possible


@banbeng

banbeng
11 Oct 2012, 13:22

" If you press a key then the dropdown list produced does contain Account as well as Symbol. "

 

I don't have this (account, symbol) in mai dropdown list!

 

 

in my program I created 4 different classes

public class tool
{


}

public class Mainr: Robot
{


}
...


I can not access symbol because this class is not
: robot?


@banbeng

banbeng
09 Oct 2012, 00:15

you can modify a pending order? 

 

I read the feature, Trade.ModifyPosition, but I think one can only apply to active orders, as it should also amend the entry point

(for bank ect, the movement of change an order is more rapid than closing down an order and open a new order)


@banbeng

banbeng
08 Oct 2012, 23:06

thanks as always

all very clear

 

I wonder if it is normal for transferring what we say to the platform I do not take

 

as pre-set words

 

account

symbol 

I have underlined the words that did not give any reaction to the program

 

    	public int ord_at()
    	{
    		int q=0;
    		foreach( var pos in Account.Positions) //position sono attivi pendingorder passivi!
    		{
    			
    			if(pos.symbolcode==symbol)
    			{
    				q++;
    			}
    		}
    		return(q);
    	
    	}



 

ver. 1.0.78 

it is normal that these words(account/sybol) do not appear in the dropdown menu???


@banbeng

banbeng
08 Oct 2012, 14:01

thanks & compliments, the program has done very well!!

 

one thing is NOT clear to me in Sample Robot with Multiple Positions: 

double? stopLossPrice =null;double? takeProfitSize =null;
why "?"
i know
 
double stoplossprice=0;
what the different????
 

 


@banbeng

banbeng
07 Oct 2012, 11:26

thanks for the replies

 

how do I filter the active orders from pending orders

those on this symbol than total

 

I would like to create a method to tell me how many orders there are active on this symbol (obviously the control must request this information to the platform)

 

exempol!!

for (int i = 0, to position.orderstotats (esempol 100), i++)

{

   if ( position[i].type== active && position[i].symbol==symbol ) {totalat++;}

   if ( position[i].type== pendent && position[i].symbol==symbol ) {totalat++;}

}


@banbeng

banbeng
30 Sep 2012, 17:00

How can I initialize an array???

 private double posx[200];

 

but does not work

sorry but i start now in calgo.. 


@banbeng