Hi, im using this code to take the crossover/under R1/S1-pivots. Using standard setting (High + Low + Close)/3.
But if you look at the attached picture, you can see it takes a pos waaaay before even reaching the R1.
Anyone know why?
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = 2*((DHigh(1) + DLow(1) + DClose(1))/3) - DLow(1)
c1 = (close CROSSES OVER indicator1)
IF c1 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to enter short positions
indicator2 = 2*((DHigh(1) + DLow(1) + DClose(1))/3) - DHigh(1)
c2 = (close CROSSES UNDER indicator2)
IF c2 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 9
SET TARGET pPROFIT 12
weird how i attached it two times without it showing, well there it is 🙂
Have you tried using Cursor Details to analyse / compare price levels and Indicator Levels?
It appears to be entering trades correctly (Close is > Indicator 1) … see the re arrow heads on attached.
Here’s a Short … all looks good??
well, yes, some trades it gets right, but look at my picture, you can see it takes the trade way off the line? not even close to the line
Use GRAPH to plot the value of your pivot calculation to compare with that of the indicator on your chart.
I note that you posted on a Monday so your strategy pivot calculation will be using the Sunday data for its calculation which will mean that the lines are very close together. Perhaps the indicator on the chart is using Friday data?
Sunday data or not (as Vonasi said). Custom trading hours on your chart? OHLC instruction with a “D” (Dclose, Dlow, ..) use real (official) and standard market hours for the instrument, not the custom ones displayed on your chart.