west greenwich, ri, usa
Experience: Intermediate
Platform: NinjaTrader
Broker: PFG Best
Trading: gbp/usd
Posts: 31 since Oct 2010
Thanks Given: 52
Thanks Received: 12
|
I have an indicator that I use in Metastock ProFX to draw rolling pivot lines during a 4 hour period, based on High, Low, Close of previous 4 hour period.
I use these for forex trading only. The time periods are 0100-0500, 0500-0900, 0900-1300, 1300-1700, 1700-2100, and 2100-0100, all times EST.
For example, at 0500 EST, pivot lines, including the central pivot (blue line) as well as two support and two resistance pivots (solid red lines), and mid-points in between each support and resistance line (dashed red lines) are automatically drawn based on the High, Low and closing price from 0100-0500. See attached image.
Here is the metastock code:
new:= Mod(Hour()-1,4)=0 AND Minute()=0;
yh:=ValueWhen(1,new, Ref(HighestSince(1,new,H),-1));
yl:=ValueWhen(1,new, Ref(LowestSince(1,new,L),-1));
yc:=ValueWhen(1,new, Ref(C,-1));
pp:=(yc+yh+yl)/3;
r1:=(pp*2)-yl;
r1m:=r1-((r1-pp)/2);
s1:=(pp*2)-yh;
s1m:=pp-((pp-s1)/2);
r2:=pp+r1-s1;
r2m:=r2-((r2-r1)/2);
s2:= pp-r1+s1;
s2m:=s1-((s1-s2)/2);
r2;
r2m;
r1;
r1m;
pp;
s1m;
s1;
s2m;
s2
Typically I plot these 4 hour pivot lines on a 3 minute GBPUSD chart. I look for short signals below the central blue pivot line and long signals above, using either the support or resistance lines for profit targets, depending upon whether I am short or long. Often, these targets work out rather well for FOREX trading.
I do not know how to program in Ninjatrader. Can anyone help?
Thanks!
|