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.






Rate this Download:

Download File


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

User Comments

Click to subscribe to comments RSS feed...
No Member Photo by Alexandr posted Thursday, September 08, 2011
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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?
No Member Photo by alegera posted Thursday, March 10, 2011
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by Administrator posted 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
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by alegera posted Wednesday, March 09, 2011
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by fxuser posted Wednesday, December 08, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
>> 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 by Chilliconcarni posted Tuesday, December 07, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by BEGINNER posted Thursday, September 16, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by BEGINNER posted Thursday, September 16, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by Tony posted Thursday, January 28, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by p.costa posted Tuesday, January 26, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
additional information in ava trader platform:

the strategy works also if time is setted in seconds.

Example:  '15.30.20'
No Member Photo by p.costa posted Monday, January 25, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
for ava trader user...

USE THIS TIME FORMAT example: '10.20.00'

it works!!!!
No Member Photo by Chipsman2 posted Monday, January 25, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
[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 by cHIPSMAN posted Monday, January 25, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by p.costa posted Monday, January 25, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
I use AVA Trader Platform.

yes, it's unusual...i'll try another format.
No Member Photo by bobby posted Monday, January 25, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by p.costa posted Friday, January 22, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by Charley posted Friday, January 22, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by Chipsman2 posted Thursday, January 21, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by Charley posted Wednesday, January 20, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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 by eMoe posted Wednesday, January 20, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
- 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 by Chipsman2 posted Tuesday, January 19, 2010
Sorry you don't have permission to rate comments. 0 Sorry you don't have permission to rate comments.
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


Comment require login or registration.

Details
Type: SCRIPT

Article has been viewed 6,614 times.

Options