WTF is this? - futures io
futures io



WTF is this?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one sixhundread with 5 posts (2 thanks)
    2. looks_two ABCTG with 2 posts (2 thanks)
    3. looks_3 kevinkdog with 2 posts (3 thanks)
    4. looks_4 SunTrader with 1 posts (2 thanks)
      Best Posters
    1. looks_one SunTrader with 2 thanks per post
    2. looks_two kevinkdog with 1.5 thanks per post
    3. looks_3 ABCTG with 1 thanks per post
    4. looks_4 sixhundread with 0.4 thanks per post
    1. trending_up 343 views
    2. thumb_up 9 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

WTF is this?

(login for full post details)
  #1 (permalink)
sixhundread
Vienna and Austria
 
 
Posts: 27 since Jul 2021
Thanks: 19 given, 6 received

Can anyone tell me what this is and how it can be fixed?

Thanks a lot!

Attached Thumbnails
Click image for larger version

Name:	404.PNG
Views:	106
Size:	40.2 KB
ID:	315146  
Reply With Quote

Can you help answer these questions
from other members on futures io?
Script to add a moving average
ThinkOrSwim
Can anyone create Risk Manager for MT5?
Traders Hideout
Bars repainting
ThinkOrSwim
TradingView help in improving Anchored Vwap
Platforms and Indicators
Investment Advisors?
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on futures io
How quickly do algos go bad?
76 thanks
Question about intraday margins
61 thanks
Avoiding Account Killing Freight Trains
24 thanks
How would you annotate this chart?
17 thanks
Spoo-nalysis ES e-mini futures S&P 500
14 thanks
 
(login for full post details)
  #2 (permalink)
SunTrader
Boca Raton, FL
 
 
Posts: 168 since Nov 2018
Thanks: 43 given, 124 received


sixhundread View Post
Can anyone tell me what this is and how it can be fixed?

Thanks a lot!

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

Reply With Quote
The following 2 users say Thank You to SunTrader for this post:
 
(login for full post details)
  #3 (permalink)
sixhundread
Vienna and Austria
 
 
Posts: 27 since Jul 2021
Thanks: 19 given, 6 received



SunTrader View Post
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

Thank you very much! I fixed it with yourt advice!!!! THANKS

Reply With Quote
 
(login for full post details)
  #4 (permalink)
sixhundread
Vienna and Austria
 
 
Posts: 27 since Jul 2021
Thanks: 19 given, 6 received


SunTrader View Post
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

I keep getting this message at another strategie can u tell me what i did wrong here?


Reply With Quote
 
(login for full post details)
  #5 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,260 since Apr 2013
Thanks: 417 given, 1,506 received

sixhundread,

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


sixhundread View Post
I keep getting this message at another strategie can u tell me what i did wrong here?



Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #6 (permalink)
 kevinkdog   is a Vendor
 
 
Posts: 3,092 since Jul 2012
Thanks: 1,648 given, 6,136 received


sixhundread View Post
I keep getting this message at another strategie can u tell me what i did wrong here?


Post your code, and someone can help. It may be an error embedded in a function, not always easy to find, sometimes really easy...

Follow me on Twitter Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #7 (permalink)
sixhundread
Vienna and Austria
 
 
Posts: 27 since Jul 2021
Thanks: 19 given, 6 received


kevinkdog View Post
Post your code, and someone can help. It may be an error embedded in a function, not always easy to find, sometimes really easy...

Input: BarNo(0), SL(0), PT(0), MP(0);
Vars: Trigger(0), BSLevel(0), TotTr(0), ExpVar(0), Prof(0), TotProf(0), TradeStr1("");

{****Filters****}
Trigger = Average (C,200);

{****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;

If LastBarOnChart Then Begin
ExpVar = BarNo;
TotProf = TotProf / Totaltrades;
TradeStr1 = Leftstr(Getsymbolname, 2) + "," + Numtostr(ExpVar, 2) + "," + Numtostr(TotProf*100, 2) + "," + Newline;
Fileappend("C:\Temp\BJ.cvs", TradeStr1);
End;

Reply With Quote
 
(login for full post details)
  #8 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,260 since Apr 2013
Thanks: 417 given, 1,506 received

sixhundread,

start with the two divisions at the bottom of the code (under "{****beikl****}") and add a logic similar to what the error message suggested.

Regards,

ABCTG



sixhundread View Post
Input: BarNo(0), SL(0), PT(0), MP(0);
Vars: Trigger(0), BSLevel(0), TotTr(0), ExpVar(0), Prof(0), TotProf(0), TradeStr1("");

{****Filters****}
Trigger = Average (C,200);

{****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;

If LastBarOnChart Then Begin
ExpVar = BarNo;
TotProf = TotProf / Totaltrades;
TradeStr1 = Leftstr(Getsymbolname, 2) + "," + Numtostr(ExpVar, 2) + "," + Numtostr(TotProf*100, 2) + "," + Newline;
Fileappend("C:\Temp\BJ.cvs", TradeStr1);
End;


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #9 (permalink)
 kevinkdog   is a Vendor
 
 
Posts: 3,092 since Jul 2012
Thanks: 1,648 given, 6,136 received


sixhundread View Post
Input: BarNo(0), SL(0), PT(0), MP(0);
Vars: Trigger(0), BSLevel(0), TotTr(0), ExpVar(0), Prof(0), TotProf(0), TradeStr1("");

{****Filters****}
Trigger = Average (C,200);

{****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;

If LastBarOnChart Then Begin
ExpVar = BarNo;
TotProf = TotProf / Totaltrades;
TradeStr1 = Leftstr(Getsymbolname, 2) + "," + Numtostr(ExpVar, 2) + "," + Numtostr(TotProf*100, 2) + "," + Newline;
Fileappend("C:\Temp\BJ.cvs", TradeStr1);
End;


Seems like this strategy, with default settings, takes 0 trades or (in the case I ran) 1 trade that never closed.

So, change the last section of code to:

If LastBarOnChart Then Begin
ExpVar = BarNo;
TotProf=0;
If TotalTrades>0 then TotProf = TotProf / Totaltrades;
//TotProf = TotProf / Totaltrades;
TradeStr1 = Leftstr(Getsymbolname, 2) + "," + Numtostr(ExpVar, 2) + "," + Numtostr(TotProf*100, 2) + "," + Newline;
Fileappend("C:\Temp\BJ.cvs", TradeStr1);
End;



And it will work. But, now the issue is why is it not generating trades. That is something you'll have to figure out...

Follow me on Twitter Reply With Quote
The following 2 users say Thank You to kevinkdog for this post:
 
(login for full post details)
  #10 (permalink)
sixhundread
Vienna and Austria
 
 
Posts: 27 since Jul 2021
Thanks: 19 given, 6 received



kevinkdog View Post
Seems like this strategy, with default settings, takes 0 trades or (in the case I ran) 1 trade that never closed.

So, change the last section of code to:

If LastBarOnChart Then Begin
ExpVar = BarNo;
TotProf=0;
If TotalTrades>0 then TotProf = TotProf / Totaltrades;
//TotProf = TotProf / Totaltrades;
TradeStr1 = Leftstr(Getsymbolname, 2) + "," + Numtostr(ExpVar, 2) + "," + Numtostr(TotProf*100, 2) + "," + Newline;
Fileappend("C:\Temp\BJ.cvs", TradeStr1);
End;



And it will work. But, now the issue is why is it not generating trades. That is something you'll have to figure out...

Thanks it worked out so far!


I got this code aswell it generates Trades, but only if you change to timeframe to daily and 20 years back!


Input: BarNo(0), SL(0), PT(0), MP(0);
Vars: Trigger(0), BSLevel(0), TotTr(0), ExpVar(0), Prof(0), TotProf(0), TradeStr1("");

{****Filters****}
Trigger = Average (C,200);

{****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;

If LastBarOnChart Then Begin
ExpVar = BarNo;
TotProf = TotProf / Totaltrades;
TradeStr1 = Leftstr(Getsymbolname, 2) + "," + Numtostr(ExpVar, 2) + "," + Numtostr(TotProf*100, 2) + "," + Newline;
Fileappend("C:\Temp\BJ.cvs", TradeStr1);
End;

{*****Zeit-/Trailingstop*****}

If Barssinceentry >= BarNo Then Begin
Sell ("Exit Long Time") Tomorrow at C Stop;
Buy to Cover ("Exit Short Time") Tomorrow at C stop;

End;

Reply With Quote
The following 2 users say Thank You to sixhundread for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > WTF is this?


Last Updated on July 19, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing

A Transparent Glimpse Into a Prop Traders Life w/Chris Gray @ Earn2Trade

Elite only
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts