Orders at Predefined Time Strategy

Expand / Collapse
 

Orders at Predefined Time Strategy


Orders at Predefined Time Strategy


This strategy allows the trader to create two OCO Orders at the particular time.

The trader can predefine the time, the number of account, the number of lots, the instrument, stop and limit distance in the Settings before starting the strategy:




The strategy checks the current time as often as new rates are received. When the current time is bigger or equal to the predefined time, the strategy places two entry OCO's.



When one of the orders in the pair is executed, the other one will be automatically removed.





Download File


Time Strategy.act Time Strategy.act (3.19 KB, 1,049 views)

User Comments

Click to subscribe to comments RSS feed...

No Member Photo
View Members Profile...,Posted By by Chipsman2 added Tuesday, January 19, 2010


Hi,
is there a possibility to write down the distance between the current price and the buy order AND the distance between the current price and the sell order???

for example:
    Canlde History ..........
    Account...........
    Account(Lots).........
    Entry Orders Time ..........
>>> Entry Distance Buy Order: 200 <<<<
>>> Entry Distance Sell Order: 150 <<<<
    Limit....
    Stop....

How can I change the strategy that I have that option to write down the distance between the marketprice and the buy-order and the distance between the marketprice and the sell-order separately?

does this program check the time frequently every second?

thanks
best regards
 

No Member Photo
View Members Profile...,Posted By by eMoe added Wednesday, January 20, 2010


- does this program check the time frequently every second?

No, my friend, as they say above:

"The strategy checks the current time as often as new rates are received."

I also wish it were possible to check the time every second, but as far as I know, there is no such opportunity now.

 

No Member Photo
View Members Profile...,Posted By by Charley added Wednesday, January 20, 2010


Hello Chipsman, hope this will help you:

...
Amount, Point: Double; 
ESBuyPrice, ESSellPrice, Stop, Limit: Integer;
LastTime: TDateTime;
...

...
AddStringSetting(@EOTime, 'Entry Orders Time', '15:00:00');  //setting up the time to place the Entry Orders
AddIntegerSetting(@ESBuyPrice, 'Entry Stop Buy Distance', 20);   //setting up entry stop distance in pips for buy positions
AddIntegerSetting(@ESSellPrice, 'Entry Stop Sell Distance', 20);   //setting up entry stop distance in pips for sell positions

AddIntegerSetting(@Stop, 'Stop', 15);     //setting up stop in pips
...

...
begin
    CreateEntryOrder(History.Instrument, Account, Amount, bsBuy,
                  History.Instrument.Buy + ESBuyPrice*Point,
                  History.Instrument.Sell + ESBuyPrice*Point-Stop*Point,
                  History.Instrument.Sell + ESBuyPrice*Point+Limit*Point,
                  otEStop,'EntryStopBuy');                 
    CreateEntryOrder(History.Instrument, Account, Amount, bsSell,
                  History.Instrument.Sell - ESSellPrice*Point,
                  History.Instrument.Buy - ESSellPrice*Point+Stop*Point,
                  History.Instrument.Buy - ESSellPrice*Point-Limit*Point,
                  otEStop,'EntryStopSell');
end;
...

 

No Member Photo
View Members Profile...,Posted By by Chipsman2 added Thursday, January 21, 2010


thanks a lot, charlie and moe, for your answers.

it helps a lot!

one last question...

is there a possibility to write a program that set the two orders just after i started the strategy-program??? so the time will be not nessesary any more?!
how do i have to write it?

thanks
best regards



 

No Member Photo
View Members Profile...,Posted By by Charley added Friday, January 22, 2010


This is not difficult to do: you need to remove these lines:

CreateEntryOrder(History.Instrument, Account, Amount, bsBuy,
                  History.Instrument.Buy + ESBuyPrice*Point,
                  History.Instrument.Sell + ESBuyPrice*Point-Stop*Point,
                  History.Instrument.Sell + ESBuyPrice*Point+Limit*Point,
                  otEStop,'EntryStopBuy');                 
    CreateEntryOrder(History.Instrument, Account, Amount, bsSell,
                  History.Instrument.Sell - ESSellPrice*Point,
                  History.Instrument.Buy - ESSellPrice*Point+Stop*Point,
                  History.Instrument.Buy - ESSellPrice*Point-Limit*Point,
                  otEStop,'EntryStopSell');


from the procedure OnNewRate, and paste them into the procedure OnStart.

(I advice you to check the resulting logic in the Tester first)
 

No Member Photo
View Members Profile...,Posted By by p.costa added Friday, January 22, 2010


Hi all,

sorry but when i run my strategy, this message is displayed:

Exception at trading strategy "TimeStrategy" in routine OnNewRate at Line:Column 39:5
''15:00:00'' is not a valid time.

so the strateegy stops.

Why?

Thanks.
Bye


 

No Member Photo
View Members Profile...,Posted By by bobby added Monday, January 25, 2010


That's very unusual: I have never received such an error. Perhaps the time format used in your installation of the platform differs from the one used in the strategy. perhaps you should try inputting '3:00:00 PM'  or anything like that instead of '15:00:00'
 

No Member Photo
View Members Profile...,Posted By by p.costa added Monday, January 25, 2010


I use AVA Trader Platform.

yes, it's unusual...i'll try another format.
 

No Member Photo
View Members Profile...,Posted By by cHIPSMAN added Monday, January 25, 2010


Hello everyone,

concerning this strategy, how can I start the strategy with a different index as basic configuration, because I dont want to change everytime manually. Furthermore which value do I have to use for 1 minute instead of the standard configuration of 15min.

Best regards,

Chipsman
 

No Member Photo
View Members Profile...,Posted By by Chipsman2 added Monday, January 25, 2010


[21:04:54] Sonne1984: Hello everyone,

concerning this strategy, how can I start the strategy with a different index as basic configuration, because I dont want to change everytime manually. Furthermore which value do I have to use for 1 minute instead of the standard configuration of 15min.

Best regards,

Chipsman
 

No Member Photo
View Members Profile...,Posted By by p.costa added Monday, January 25, 2010


for ava trader user...

USE THIS TIME FORMAT example: '10.20.00'

it works!!!!
 

No Member Photo
View Members Profile...,Posted By by p.costa added Tuesday, January 26, 2010


additional information in ava trader platform:

the strategy works also if time is setted in seconds.

Example:  '15.30.20'
 

No Member Photo
View Members Profile...,Posted By by Tony added Thursday, January 28, 2010


p.costa, thanks a lot for your advice!! Ohterwise I would not be able to get this strategy to work :)

Chipsman, you only need to replace this line:

AddCandleHistorySetting(@History, 'Candle History', '', CI_15_Minutes, 100);   //setting up the chart history

with this one:

AddCandleHistorySetting(@History, 'Candle History', '', CI_1_Minute, 100);   //setting up the chart history
 

No Member Photo
View Members Profile...,Posted By by BEGINNER added Thursday, September 16, 2010


Hello Dear Friends ..
I think I have a good idea for this strategy, but unfortunately I can not read as the English language: Is anyone speaks Russian, whose help will be able to make some changes in the strategy of this beautiful, thank you in advance, and sorry for my bad English.
 

No Member Photo
View Members Profile...,Posted By by BEGINNER added Thursday, September 16, 2010


However I will try to expound my idea. If the price go X point is HIGH, that was recorded on zz:yy:00 candle, then have BUY position, and we decided  possibility STOP and LIMIT, and if it tackles the SAME CANDLE LOW, then have have SELL. For example on candle 15:15:00 HIGH = 1.2715, LOW = 1.2705, X = 3: If the price reaches 1.2718, then we fulfill BUY, our STOP for example 20, and our LIMIT for example 40. And if the price lowers to 1.2702, then made a SELL. thank you in advance, and sorry for my bad English.
 

No Member Photo
View Members Profile...,Posted By by Chilliconcarni added Tuesday, December 07, 2010


Hi Guy's - I just can't this script to run.  What I'm trying to do is to look back at the previous 2,3 or 4 candles and if there are consecutive previous down candles then buy (ON THE OPEN OF THE NEW CANDLE) or if consecutive previous up candles sell (ON THE OPEN OF THE NEW CANDLE).  Although this strategy could be applied to any time frame I'm only interested in day candles, which for me changes at 5am (GMT).

Is is possible to adjust the above script (Time Strategy.act) to capture this functionality.  Thanks in advance for any feedback and / or solutions.

Chilli

 
 

No Member Photo
View Members Profile...,Posted By by fxuser added Wednesday, December 08, 2010


>> to Chilliconcarni:

hi, I think it's not hard, if you explain what you want on forum, I think someone will help you
 

No Member Photo
View Members Profile...,Posted By by alegera added Wednesday, March 09, 2011


I got this error message every time i try to run strategy. Could you explain why.


Exception at trading strategy "TimeStrategy1" in routine OnNewRate at Line:Column 46:6
Closing of individual positions is restricted; please contact the dealing desk.
 

No Member Photo
View Members Profile...,Posted By by Administrator added Thursday, March 10, 2011
Supreme Being with 290 recognition pointsSupreme Being with 290 recognition pointsSupreme Being with 290 recognition pointsSupreme Being with 290 recognition pointsSupreme Being with 290 recognition pointsSupreme Being with 290 recognition pointsSupreme Being with 290 recognition pointsSupreme Being with 290 recognition points


Dear alegera!

This message appears when your system is under NFA rules, and you try to launch non NFA compliant strategy.

See more information about NFA here: http://forum.actfx.com/Topic1954-17-1.aspx

Best regards
ACTFX Forum Administrator
 

No Member Photo
View Members Profile...,Posted By by alegera added Thursday, March 10, 2011


So if this is the rule ---  

This is about NFA Compliance Rule 2-43(b) regulating the Forex trading in the USA. This rule prohibits traders from carrying offsetting positions in their accounts and requires that they be offset on a first-in, first-out (FIFO) basis.
In your case Stops and Limits are prohibited too in order to maintain this FIFO order of positions closing.

could you explain why i can set limits and entry orders manually? In practice when setting limit, stop loss, or entry order i breaking this rule... or i say when ill try to do it with preprogrammed command line its just not working??? 

-----  This rule prohibits traders from carrying offsetting positions in their accounts and requires that they be offset on a first-in, first-out (FIFO) basis. -----
So how the world is trading in this case????

Sorry if asking may be dumb question, i just cant put this one together i try to find some explanations.... Thanks
 

No Member Photo
View Members Profile...,Posted By by Alexandr added Thursday, September 08, 2011


Good day! Is it possible to write such a strategy: When crossing AROONUP down given by the line, opening the position up and crossing the same line AROONDOWN openingdown. And how do Autotrading on this strategy?
 


Your name: *
Verification Code:
*
 

Details
Type: SCRIPT
Article has been viewed 3,304 times.
Options