Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
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.
{****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;