Good morning,
my idea is the following:
Count the bars since the opening until my indicator1=100.
If myindicator1=100 the 7th bar then i want to buy if price>highest high of the 1st to 7th bar. And sell if the price< lowest low of the 1st to 7 bar.So It is a very simple and basic idea.
I tried to code like this:
VARS:
count(0),
countstop(0),
buysignal(0),
sellsignal(0);
If date<>date[1] then begin
If myindicator1<100 then count=count[1]+1;
If myindicator1=100 then countstop=countstop[1]+1;
If countstop=1
End;
If countstop=1 then value1=count[1];
buysignal=highest(high,value1);
sellsignal=lowest(low,value1);
If close>buysignal then buy;
If close<sellsignal the sell;
If later in the same day myindicator1=100 again, it is not to be calculated. The value1 is fixed once for the all day. I'm just interested for the first time it occurs in the same day.
Thanking you,
SCR
my idea is the following:
Count the bars since the opening until my indicator1=100.
If myindicator1=100 the 7th bar then i want to buy if price>highest high of the 1st to 7th bar. And sell if the price< lowest low of the 1st to 7 bar.So It is a very simple and basic idea.
I tried to code like this:
VARS:
count(0),
countstop(0),
buysignal(0),
sellsignal(0);
If date<>date[1] then begin
If myindicator1<100 then count=count[1]+1;
If myindicator1=100 then countstop=countstop[1]+1;
If countstop=1
End;
If countstop=1 then value1=count[1];
buysignal=highest(high,value1);
sellsignal=lowest(low,value1);
If close>buysignal then buy;
If close<sellsignal the sell;
If later in the same day myindicator1=100 again, it is not to be calculated. The value1 is fixed once for the all day. I'm just interested for the first time it occurs in the same day.
Thanking you,
SCR