Specific time

Created at 22 Jul 2017, 18:57
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
DelFonseca's avatar

DelFonseca

Joined 25.06.2017

Specific time
22 Jul 2017, 18:57


Hi everyone,

I am trying to create a bot that opens operations at a specific hour and minute based on the previous day, ie if the previous day is fall, the bot opens operation in the opposite direction, purchase.
The take and the stop will vary from market to market.

Can someone help me?
Thank you so much


@DelFonseca
Replies

lec0456
22 Jul 2017, 20:51

If you wanted to place a trade everyday at 8:15 UTC, for example, you could just say:

If (Server.Time.Hour==8 && Server.Time.minute==15)

Execute Trade...

 

you get the daily series by:

  Daily = MarketData.GetSeries(TimeFrame.Daily);

And the index by:

var dailyindex = Daily.OpenTime.GetIndexByTime(MarketSeries.OpenTime[t0]);

and get yesterdays high by:

 Daily.High[dailyindex-1];

 


@lec0456

DelFonseca
23 Jul 2017, 20:07

RE:

lec0456 said:

If you wanted to place a trade everyday at 8:15 UTC, for example, you could just say:

If (Server.Time.Hour==8 && Server.Time.minute==15)

Execute Trade...

 

you get the daily series by:

  Daily = MarketData.GetSeries(TimeFrame.Daily);

And the index by:

var dailyindex = Daily.OpenTime.GetIndexByTime(MarketSeries.OpenTime[t0]);

and get yesterdays high by:

 Daily.High[dailyindex-1];

 

Thank you so much lec0456
i'll try.
tanhk you


@DelFonseca

DelFonseca
28 Jul 2017, 21:05

i cant create the bot :(


@DelFonseca