Topics
07 Sep 2020, 20:49
 1335
 3
14 Jan 2020, 23:28
 1001
 4
14 Feb 2018, 22:19
 1557
 2
27 Mar 2015, 18:14
 2098
 2
18 Mar 2015, 14:02
 2627
 2
Replies

RodMar
21 Jan 2020, 22:44

Automate API Version number

Hello,

you can find the version number of the Automate API under " Version version =  Robot.Application.Version; ". Version is a data type ( class )  from System. 

Kindly regards,

RodMar

 


@RodMar

RodMar
11 Feb 2016, 01:09

RE:

Shawn_Mapilot said:

I would like to update the stop loss on my position every bar to equal a overlay indicator such as ichimoku kijunsen.

I tried to make it work but it seems to not update every bar, wondering if im missing something.

So my code goes like 

  protected override void OnBar()
        { 

double StopLoss = Math.Abs(ichimoku.KijunSen.Last(1) - longPosition.EntryPrice) / Symbol.PipSize;

if( LongPosition != null)

{

 ModifyPosition(longPosition, StopLoss, null);

}

if(ShortPosition!= null)

{

ModifyPosition(shortPosition,StopLoss,null);

}

}

//////

Any help will be greatly appreciated. Thanks!

Try to start "OnBar()" inside "OnStart()". Like this:  protected override void  OnStart() { ...   ....    .... OnBar(); }

Perhaps it works.

J. Martins


@RodMar

RodMar
10 Feb 2016, 23:59 ( Updated at: 17 Mar 2016, 15:09 )

RE:

JoaoRMartins said:

 

Hello,

 

since the last update cAlgo executes only  once "OnTick()", after "OnStart()", and then nothing! No  more "OnTick()"s!!!....

The business logik is not done!

 

Kind regards,

J. Martins

 

Thanks for the update.

With the most symbols it seems now OK.

But with, for example, AUDUSD (h6) it blocked up on the 1. tick ("OnTick()")....

Nevertheless if I start "OnBar()"  at end of  "OnStart()", it doesn't block any more, and everything seems OK!

Kind regards,

J. Martins

 


@RodMar

RodMar
10 Feb 2016, 16:31 ( Updated at: 17 Mar 2016, 15:09 )

 

Hello,

 

since the last update cAlgo executes only  once "OnTick()", after "OnStart()", and then nothing! No  more "OnTick()"s!!!....

The business logik is not done!

 

Kind regards,

J. Martins

 


@RodMar

RodMar
22 May 2015, 20:05

RE:

maxwell said:

Hey, I wonder how you can implement an dynamic array where the size is not fixed, where you can store dat?

I thought you can youse C#, but List dosnt work.

 

 List<T>  works. You must include "using System.Collections.Generic;" ( and restart cAlgo after building);


@RodMar