Help with indicator coding - futures io
futures io futures trading



Help with indicator coding


Discussion in EasyLanguage Programming

Updated
    1. trending_up 905 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 10 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
 

Help with indicator coding

(login for full post details)
  #1 (permalink)
Ukraina
 
 
Posts: 17 since Aug 2010
Thanks: 5 given, 0 received

Hello! Help with the coding indicator.
It is necessary that if the tick exceeds the tick and this condition is also fulfilled on the next bar, then the values of these ticks should be summed up before the appearance of the down tix over the apix. And output this summarized histogram at the bottom of the chart.
Here is the code I wrote. But apparently there are errors. Please help me fix it.

 
Code
Vars:
UTSum( 0 ),
DTSum( 0 );

array :
UT[](0),
DT[](0);

UT [value1] = UpTicks(value1);
DT [value1] = DownTicks(value1);

if BarType <= 1 or BarType >= 5 then

If (UpTicks > DownTicks) then
begin
UTSum = array_sum(UT,0,value1-1);

Plot1( UTSum, "VolUp",Blue ) ;
end;


If (UpTicks < DownTicks) then

begin
DTSum = array_sum (DT,0,value1-1);

Plot2( DTSum, "VolDn",red ) ;
end;
Plot3( 0, "Zero");

Attached Thumbnails
Click image for larger version

Name:	Screenshot_8.png
Views:	43
Size:	18.0 KB
ID:	258975  
Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(170 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 received


Fobos,

can you elaborate a bit more what exactly you are trying to compute and to measure as this might help in pointing you in the right direction.

Instead of using arrays you might just require two variables that you reset when the opposite condition is met and otherwise add the the value of Up- or DownTicks.

Besides that your "if BarType <= 1 or BarType >= 5 then" statement only affects part of your code, is this intended?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #4 (permalink)
Ukraina
 
 
Posts: 17 since Aug 2010
Thanks: 5 given, 0 received


ABCTG View Post
Fobos,

can you elaborate a bit more what exactly you are trying to compute and to measure as this might help in pointing you in the right direction.

Instead of using arrays you might just require two variables that you reset when the opposite condition is met and otherwise add the the value of Up- or DownTicks.

Besides that your "if BarType <= 1 or BarType >= 5 then" statement only affects part of your code, is this intended?

Regards,

ABCTG

The idea is this. If up ticks in a bar are more than down ticks and in subsequent bars the same condition, then sum up ticks. As soon as subsequent bars exceed down ticks more up ticks, then sum the down ticks. And the amount of up ticks and down ticks display on the historgam below.

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Ukraina
 
 
Posts: 17 since Aug 2010
Thanks: 5 given, 0 received

If not through an array, then how to do it? Help with the code.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 received

Fobos,

based on your code you could accomplish the same with two variables. When your condition "If (UpTicks > DownTicks) " is met you add the value of UpTicks to a variable and vice versa using another variable for your second condition, but using DownTicks.
This way these two variables will hold the summation of UpTicks and DownTicks for the bars where your conditions are valid.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #7 (permalink)
Ukraina
 
 
Posts: 17 since Aug 2010
Thanks: 5 given, 0 received


ABCTG View Post
Fobos,

based on your code you could accomplish the same with two variables. When your condition "If (UpTicks > DownTicks) " is met you add the value of UpTicks to a variable and vice versa using another variable for your second condition, but using DownTicks.
This way these two variables will hold the summation of UpTicks and DownTicks for the bars where your conditions are valid.

Regards,

ABCTG

 
Code
Vars:
UTSum( 0 ),
DTSum( 0 );



if BarType <= 1 or BarType >= 5 then

If (UpTicks > DownTicks) then
begin
UTSum = UTSum + UpTicks;

Plot1( UTSum, "VolUp",Blue ) ;
end;

if BarType <= 1 or BarType >= 5 then

If (UpTicks < DownTicks) then

begin
DTSum = DTSum + DownTicks ;

Plot2( DTSum, "VolDn",red ) ;
end;
Plot3( 0, "Zero");
Changed the code. But now he summarizes the progression.How to reset the summation after the opposite condition?

Attached Thumbnails
Click image for larger version

Name:	Screenshot_8.png
Views:	45
Size:	73.8 KB
ID:	259013  
Reply With Quote
 
(login for full post details)
  #8 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 received

Fobos,

you could for example set the variable to 0 when the opposite condition is met.

Regards,

ABCTG


Fobos
How to reset the summation after the opposite condition?


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #9 (permalink)
Ukraina
 
 
Posts: 17 since Aug 2010
Thanks: 5 given, 0 received


ABCTG View Post
Fobos,

you could for example set the variable to 0 when the opposite condition is met.

Regards,

ABCTG

Thank you so much! Everything worked out. Tell me, what else is the opportunity to do this? For general development is interesting.

Reply With Quote
 
(login for full post details)
  #10 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 received


Fobos ,

you are welcome.

I am afraid I don't understand what you mean with "what else is the opportunity to do this?", maybe you can elaborate a bit more what you mean?

Regards,

ABCTG


Fobos View Post
Thank you so much! Everything worked out. Tell me, what else is the opportunity to do this? For general development is interesting.


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #11 (permalink)
Ukraina
 
 
Posts: 17 since Aug 2010
Thanks: 5 given, 0 received


ABCTG View Post
Fobos ,

you are welcome.

I am afraid I don't understand what you mean with "what else is the opportunity to do this?", maybe you can elaborate a bit more what you mean?

Regards,

ABCTG

I thought maybe there are more options for how to reset the summation when the new condition is met.
Thank you for your help!

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Help with indicator coding


Last Updated on November 16, 2018


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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