How to get time interval of the chart? Expand / Collapse
Author
Message
Posted 6/24/2010 1:24:40 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 6/30/2011 1:30:04 PM
Posts: 29, Visits: 67
Hello, I need to store the time interval of the chart in a variable.
I using the same robot in all time intervals... so, to avoid the duplicate order tags, I am using manually the follow tag:

var
Period: String;

OnCreate
AddStringSetting(@Period, 'Period', '1M'); // for 1 minute chart interval
...
CreateOrder(History.Instrument, Account, Amount, bsBuy, NullRate, NullRate, 1, StrategyName+Period);

I would Like to do this automaticly. Is it possible?

[ ]´s

Rodolfo Andrade
www.rodorush.com.br
rodolfo@rodorush.com.br
+55(16)9193-6808
Post #1694
Posted 7/20/2010 10:08:59 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 1/27/2012 12:53:25 PM
Posts: 201, Visits: 295
Hi, Rodorush.
It depends where you want to use the period. If you want to change period of the indicator, you need to apply every new period and recalculate. As for strategy, you can use as much period variables as you want.


Best regards!
Post #1792
Posted 7/20/2010 9:44:17 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 6/30/2011 1:30:04 PM
Posts: 29, Visits: 67
ok, for exemple:
I have a robot called "RHamari". I will run this robot in "EURUSD" pair. I will put it to run in 15 min., 30 min., 1h, 2h, 4h and 8h. All at same time and at same account. How I have this line to create the orders: CreateOrder(History.Instrument, Account, Amount, bsBuy, NullRate, NullRate, 1, StrategyName+Period);

The only thing that difference the others is my variable "period" that I have to type manually before start all robots. It´s very boring to do this. So I would like to set the variable "Period" automaticaly with time the chart interval. I have to do this to avoid the robots to make mistakes between themselves. I just want a tag to create difference themselves.

[ ]´s

Rodolfo Andrade
www.rodorush.com.br
rodolfo@rodorush.com.br
+55(16)9193-6808
Post #1793
Posted 7/21/2010 4:50:29 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/7/2010 5:32:17 AM
Posts: 24, Visits: 36
Hi Rodorush.

If you want to use different time frames in your strategies you have to describe all these time frames in the head of listing. But I think you can use array for this problems. Unfortunately I have not done it yet.
Regards Den

Post #1795
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin

All times are GMT -5:00, Time now is 11:27am


© 2009 Actforex.com Terms of Use