Hi,
I’m new to ProRealTime and i hope my problem is easy to solve for some of you.
I wonder if its possible to ad a sell condition to my long position when price crosses the daily vwap?
Its easy to add the condition for MA for example, but i can’t get it to work with vwap, even though its possible to add the condition with an alarm..
Any help is greatly appreciated!
You talking manual trade or auto trade?
If auto trade then be loads easier all round if you post your code?
Okey,
// conditions to exit long positions
indicatorl = Average[50](close)
c2 = (close CROSSES OVER indicatorl)
IF c2 THEN
SELL AT MARKET
ENDIF
so this is how it looks for MA50. I basically want the same thing, but with vwap daily. I tried to change it to vwap but it didn’t work.
moy = (high+low+close)/3
W = (moy*Volume)/Volume
return w
The vwap formula is just that.
Bankman … remember there is no volume on Fx.
There is volume on Indexes and Shares.
Also bare in mind that VWAP resets at the start of a day and is very volatile until there is a decent sized data sample to calculate the average on so if you trade early in the day expect any VWAP based exit to be easily hit.
VWAP formula is:
d = max(1, intradaybarindex)
VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
(reset on each new day).