hi guys thx for the tips.
I employ a similar routine to spot if a potential system can work.
My question was more about how to structure something in easy language:
I want to count something that happened yesterday, like the price crosses an important line (e.g.:highd(1)) or moving average a few times.
Then I wait for the next day and sellshort if condition was met yesterday.
That is how far I got, code below. However if I add another condition like for example to only sellshort if the price is above yesterdays high, the whole thing falls apart. Any help on the code? Can't figure out the resets of the count vars I think!
Inputs: Price(H+L/2),profitstop(4500), highCrosseson1(2);
vars: highdCrosseson1(0), countstop(false), newday(true);
if date < date then begin
newday = true;
// Count the following:
// Yesterday, price criss crosses around yesterday's high several times.
if countstop = false then begin;
if price crosses over highd(1) then begin;
highdCrosseson1 = highdCrosseson1 + 1;
// Yesterday High crosses enough and its a new day
if highdCrosseson1 >= highCrosseson1 then begin;
countstop = true;
if countstop = true and date < date then begin;
sellshort next bar at market;
// Var Resets
if marketposition = -1 or date < date then begin;
highdCrosseson1 = 0;
countstop = false;
if date < date then highdCrosseson1 = 0;