Guess you haven't been using the platform very long?
Go to Format Indicator ---> General tab down in middle:
Maximum number of bars study will reference: and either select
- Auto-Detect
- or a number greater than what your indicator needs plus at least 10 more.
So if you are using a basic moving average (I suggest don't haha) with a length of 9, make bars back at least 19. The greater the bars needed the greater allowance over I would go. Or just use Auto-Detect.
HTH
The following 2 users say Thank You to SunTrader for this post:
according to the error message your code encountered a situation where it attempted to divide by zero. Following the solution in the error message (or using a similar check) for every division that you perform in your code should prevent this.
Regards,
ABCTG
The following user says Thank You to ABCTG for this post:
{****Retracement Entry****}
If C > Trigger and Marketposition = 0 and (L < Average(L, 6)) or
L Crosses above XAverage(L,6) and C Crosses Above XAverage(C,6) and H < XAverage(H,6) Then Begin
Buy ("Buy Support") This Bar at C;
BSLevel = C;
End;
If C < Trigger and Marketposition = 0 and (H > XAverage(H, 6) or H Crosses below XAverage(H, 6)) and C Crosses below XAverage (C, 6) and L > XAverage(L, 6) Then Begin
Sell Short ("Sell Resist") THis Bar at C;
BSLevel = 0;
End;
{****Breakout Entry****}
If C > Trigger and Marketposition = 0 and H Crosses above XAverage(H, 6) and C Crosses above XAverage(C, 6) Then Begin
Buy ("Buy Break") this bar at C;
BSLevel = 0;
End;
IF C < Trigger and Marketposition = 0 and L crosses below XAverage(L, 6) and C Crosses below XAverage(C, 6) Then Begin
Sell Short ("Sell Break") this bar at C;
BSLevel = C;
End;
{****Exit techniques****}
If Barssinceentry >= BarNo and BarNo <> 0 Then Begin
Sell ("Long Time") this bar at C; Buy to Cover ("Short time") this bar at C;
End;
IF SL <> 0 Then Begin
Sell ("Long loss") Tomorrow at BSLevel*(1 + SL*0.01)Stop;
Buy to Cover ("Short loss") Tomorrow at BSLevel*(1-SL*0.01)Stop;
End;
If PT <> 0 Then Begin
Sell ("Long profit") Tomorrow at BSLevel*(1 + PT*0.01)Limit;
Buy to Cover ("Short profit") Tomorrow at BSLevel*(1-PT*0.01)Limit;
End;
If MP <> 0 Then Begin
IF C > BSLevel*(1+MP*0.01) Then
Sell ("Long stop") Tomorrow at BSLevel*(1+MP*0.01)Stop;
IF C < BSLevel *(1-MP*0.01) Then
Buy to cover ("Short stop") tomorrow at BSLevel*(1-MP*0.01)Stop;
End;
{****beikl****}
TotTr = Totaltrades;
If TotTr > TotTr[1] Then Begin
Prof = Positionprofit(1)/(Entryprice(1)*Bigpointvalue);
TotProf = Totprof + prof;
End;
{****Retracement Entry****}
If C > Trigger and Marketposition = 0 and (L < Average(L, 6)) or
L Crosses above XAverage(L,6) and C Crosses Above XAverage(C,6) and H < XAverage(H,6) Then Begin
Buy ("Buy Support") This Bar at C;
BSLevel = C;
End;
If C < Trigger and Marketposition = 0 and (H > XAverage(H, 6) or H Crosses below XAverage(H, 6)) and C Crosses below XAverage (C, 6) and L > XAverage(L, 6) Then Begin
Sell Short ("Sell Resist") THis Bar at C;
BSLevel = 0;
End;
{****Breakout Entry****}
If C > Trigger and Marketposition = 0 and H Crosses above XAverage(H, 6) and C Crosses above XAverage(C, 6) Then Begin
Buy ("Buy Break") this bar at C;
BSLevel = 0;
End;
IF C < Trigger and Marketposition = 0 and L crosses below XAverage(L, 6) and C Crosses below XAverage(C, 6) Then Begin
Sell Short ("Sell Break") this bar at C;
BSLevel = C;
End;
{****Exit techniques****}
If Barssinceentry >= BarNo and BarNo <> 0 Then Begin
Sell ("Long Time") this bar at C; Buy to Cover ("Short time") this bar at C;
End;
IF SL <> 0 Then Begin
Sell ("Long loss") Tomorrow at BSLevel*(1 + SL*0.01)Stop;
Buy to Cover ("Short loss") Tomorrow at BSLevel*(1-SL*0.01)Stop;
End;
If PT <> 0 Then Begin
Sell ("Long profit") Tomorrow at BSLevel*(1 + PT*0.01)Limit;
Buy to Cover ("Short profit") Tomorrow at BSLevel*(1-PT*0.01)Limit;
End;
If MP <> 0 Then Begin
IF C > BSLevel*(1+MP*0.01) Then
Sell ("Long stop") Tomorrow at BSLevel*(1+MP*0.01)Stop;
IF C < BSLevel *(1-MP*0.01) Then
Buy to cover ("Short stop") tomorrow at BSLevel*(1-MP*0.01)Stop;
End;
{****beikl****}
TotTr = Totaltrades;
If TotTr > TotTr[1] Then Begin
Prof = Positionprofit(1)/(Entryprice(1)*Bigpointvalue);
TotProf = Totprof + prof;
End;