Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

skan

Intrabar Exit, Easylanguage

Recommended Posts

Hello.

 

I have an strategy that works on 15 min bars.

 

I need the strategy to exit 1 minutes before the session ends.

I've already tried to run it on 1min bars but no combination of the parameters work as well as before and it's much slower.

 

I've thought in different ways to get it.

 

 

a)

Open a 1 min chart on Data1 and another 15min chart on Data2

change the code in order to run the strategy on Data2

add a time exit on Data1

I've tried it but it doesn't run as expected, it's quite confusing

 

b)

On the same 15 min bars chart add the original strategy

and add a new one with intrabarordergeneration=true

is it the right way?

Any advise?

 

thanks

Share this post


Link to post
Share on other sites

I would not push an auto-strategy to the last minute, for several reasons:

 

1. most brokers require the last order at least 3 minutes before session end to ensure a proper fill.

 

2. if something happens between you and the broker at the last minute (e.g. internet, computer hiccup, etc),

you will have no alternative until the next session.

 

3...

Share this post


Link to post
Share on other sites

you can try this:

 

var:
Last.Order.Time(1558);

If currenttime = Last.Order.Time then
begin
   buytocover...
   sell...
end;

 

 

p.s. you will need intrabarordergeneration to execute anything intrabar.

Share this post


Link to post
Share on other sites
you can try this:

 

var:
Last.Order.Time(1558);

If currenttime = Last.Order.Time then
begin
   buytocover...
   sell...
end;

 

 

p.s. you will need intrabarordergeneration to execute anything intrabar.

 

 

 

Hello

 

But how can I activate IntraBarOrderGeneration just for this part of the code and not for all the strategy ??

Do I need to add IntraBarOrderGeneration=TRUE in the functions too ?

 

If I put 2 strategies on the same chart and one of them buys ... can I detect marketposition change from the other one? Or each strategy detects only its MP changes??

 

 

When working with intrabarordergeneration=TRUE... if I say Close[1] I mean the close of one bar ago.

How do I get the value of 3 ticks ago?

 

thanks

Edited by skan

Share this post


Link to post
Share on other sites

if your idea is to close all position at end of day,

you can use SetExitOnClose.

but you have to set your session time to X minutes before the actual close,

because it is practically not possible to submit an order at the last tick.

Share this post


Link to post
Share on other sites
Hello

 

But how can I activate IntraBarOrderGeneration just for this part of the code and not for all the strategy ??

Do I need to add IntraBarOrderGeneration=TRUE in the functions too ?

 

IOG is for the whole strategy, not a particular line.

 

 

If I put 2 strategies on the same chart and one of them buys ... can I detect marketposition change from the other one? Or each strategy detects only its MP changes??

 

thanks

 

read up on:

 

MarketPosition_at_Broker

MarketPosition_at_Broker_for_The_Strategy

Edited by Tams

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.