Intra bar generate on and off

Questions about MultiCharts and user contributed studies.
allenlowe
Posts: 37
Joined: 29 Jun 2011
Has thanked: 2 times
Been thanked: 3 times

Intra bar generate on and off

Postby allenlowe » 06 Sep 2011

Hi,

I am currently using 1 minute bar for my trading. My strategy would like to place a stop limit order good until end of the 1 minute bar but not next tick once the condition is met. I am not sure the effect of Intra bar generate within signal. Here is the sample of code I would like to use. Can someone tell me it is work or not?

Code: Select all

If barstatus = 2 then intrabargeneration = True;

If last >= 25 then
begin
Buy ("Open Long") next bar 27 Stop 28 limit;
Intrabargeneration = False;
end;
What I want is if the stock price once touch 25 within the minute, a stop limit order will be place for the rest of the minute even the stock price drop below 25 again.

Thanks for your help in advance.
Allen

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Intra bar generate on and off

Postby TJ » 07 Sep 2011

Hi,

I am currently using 1 minute bar for my trading. My strategy would like to place a stop limit order good until end of the 1 minute bar but not next tick once the condition is met. I am not sure the effect of Intra bar generate within signal. Here is the sample of code I would like to use. Can someone tell me it is work or not?

If barstatus = 2 then intrabargeneration = True;

If last >= 25 then
begin
Buy ("Open Long") next bar 27 Stop 28 limit;
Intrabargeneration = False;
end;

What I want is if the stock price once touch 25 within the minute, a stop limit order will be place for the rest of the minute even the stock price drop below 25 again.

Thanks for your help in advance.
Allen
You can always test it out on the IB demo system. It is free, and does not require registration.



ps. please use code tag when posting codes, it makes reading codes easier. I have added them for you in your post above.

allenlowe
Posts: 37
Joined: 29 Jun 2011
Has thanked: 2 times
Been thanked: 3 times

Re: Intra bar generate on and off

Postby allenlowe » 07 Sep 2011

Yes, I am testing with demo at the moment. I ask it just because I saw a few comments about intra bar order generation is not stable and therefore want to confirm my coding logic inline with the intra bar logic.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Intra bar generate on and off

Postby TJ » 07 Sep 2011

Yes, I am testing with demo at the moment. I ask it just because I saw a few comments about intra bar order generation is not stable and therefore want to confirm my coding logic inline with the intra bar logic.
with the limited information you have provided,
it is difficult to give an assessment.


ps. what does the following statement do?

Code: Select all

If barstatus = 2 then intrabargeneration = True;


Return to “MultiCharts”