Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
the IntrabarOrderGeneration attribute will affect the whole code. You can look into the reserved word BarStatus to execute certain parts of your code at the end of the bar only for example.
An other question can you tell me if something is wrong with the following section of the code for some reason it is not functioning correctly
if (data2var99 crosses over 0) and (data2var10> 0)
then begin
VVSUP = true;
VVSDN = false;
end;
if (data2var99 crosses under 0) and (data2var10> 0)
then begin
VVSUP = false;
VVSDN = true;
end;
if VVSUP then begin
if indicator crosses over 0 then buy next bar at market;
if marketposition = 1 and indicator crosses under 0 then sell next bar at market;
end;
if VVSDN then begin
if indicator crosses under 0 then sellshort next bar at market;
if marketposition =-1 and indicator crosses over 0 then buytocover next bar at market;
end;
else
if (data2var98 crosses over 0) and (data2var10< 0)
then begin
WWSUP = true;
WWSDN = false;
end;
if (data2var98 crosses under 0) and (data2var10< 0)
then begin
VVSUP = false;
VVSDN = true;
end;
if WWSUP then begin
if indicator crosses over 0 then buy next bar at market;
if marketposition = 1 and indicator crosses under 0 then sell next bar at market;
end;
if WWSDN then begin
if indicator crosses under 0 then sellshort next bar at market;
if marketposition =-1 and indicator crosses over 0 then buytocover next bar at market;
end;
end;
I would suggest to use the "print" reserved word - the helpfile and wiki will show you how to use it -
to print the values of your code when a signal should be generated.
This way you can check what is going on within your code.
I am not sure if I understand you correctly, but in case you try to issue entries on data 2 this wouldn't be possible
as you can only issue trades on data1.