can i write a line of code that if the up volume > down volume then .... - futures io
futures io futures trading



can i write a line of code that if the up volume > down volume then ....


Discussion in MultiCharts

Updated
    1. trending_up 1,182 views
    2. thumb_up 5 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 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
 

can i write a line of code that if the up volume > down volume then ....

(login for full post details)
  #1 (permalink)
Honolulu + Hawaii / USA
 
 
Posts: 18 since Jul 2014
Thanks: 16 given, 1 received

I have a program i notice when it places a trade a loses the down volume is greater than the up volume

Is there a way i can write a line of code if Up Volume > Down Volume then ....

I tried

if volume > VOVO
and
"upticks bars > DownTicks bars"
and
ROC1 > RATEY
and
Price[1] crosses above ExpAv1[1]
then
begin
buy ( "buy") Cts contracts next bar at market ;
end;

and it returns this message to me when i try to compile

------ Compiled with error(s): ------
'If' condition must be followed by the word 'Then'
line 42, column 0


[IMG] updown volume ratio by tracyrollins92, on Flickr[/IMG]

Reply With Quote

Can you help answer these questions
from other members on futures io?
Indicators for pair trading MES and M2K
Platforms and Indicators
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
ZigZag with Depth and Backstep
EasyLanguage Programming
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
23 thanks
 
(login for full post details)
  #2 (permalink)
Texas, USA
 
Experience: Advanced
Platform: TT Pro, Custom
Broker: dxFeed
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 249 since May 2014
Thanks: 596 given, 665 received


honoluluhustler View Post
I have a program i notice when it places a trade a loses the down volume is greater than the up volume

Is there a way i can write a line of code if Up Volume > Down Volume then ....

I tried

if volume > VOVO
and
"upticks bars > DownTicks bars"
and
ROC1 > RATEY
and
Price[1] crosses above ExpAv1[1]
then
begin
buy ( "buy") Cts contracts next bar at market ;
end;

and it returns this message to me when i try to compile

------ Compiled with error(s): ------
'If' condition must be followed by the word 'Then'
line 42, column 0


[IMG] updown volume ratio by tracyrollins92, on Flickr[/IMG]

My 2 cents are that it is going to be very difficult for someone to help you with questions like these. I would recommend that you at least go through a tutorial that introduces you to the basics of EasyLanguage.

I would also recommend including your intended program logic in plain language so that someone understands what exactly you are trying your code to do for you.

The more specific the question, the better chances you have at getting it answered.

For this specific error message, I am copying the built in TradeStation help which you can easily access by pressing F1 in the Development environment:


EL Reserved Words and Functions - TradeStation Help
If (Reserved Word)
image\trumpet2.gif Disclaimer

This word is used to introduce a condition that will be evaluated to determine execution of additional code.

If

Remarks
If can only be used to begin an If... Then or If... Then... Else statement.

In order to use an If... Then... Else statement, a Begin... End statement must follow Then as in the second example below.

Examples
If Condition1 Then
{Your Code Line1}

If is used here to start the If... Then statement. The Line1 code will be executed if Condition1 returns a value of True. If Condition1 is false, the Line1 code will not be executed.

If Condition1 And Condition2 Then Begin
{Your Code Line1}
{Your Code Line2, etc.}
End
Else Begin
{Your Code Line3}
{Your Code Line4, etc.}
End;

If is used here to start the If... Then... Else statement. The Line1 and Line2 code will be executed if Condition1 and Condition2 return a value of True. If Condition1 or Condition2 is false, the Line3 and Line4 code will be executed.


Visit my futures io Trade Journal Reply With Quote
The following 3 users say Thank You to Hulk for this post:
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


honoluluhustler,

in my opinion you are looking for the reserved words UpTicks and DownTicks, they will only work with realtime data though. It appears the error comes from you using words that are not recognized by the compiler.
I would like to second what @Hulk wrote, take the time going over some tutorials or the EL Essentials PDF and I can almost guarantee you that it will boost your coding to a new level. In the end you will save a lot of time and hassle by devoting some time to laying a solid foundation.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #4 (permalink)
Honolulu + Hawaii / USA
 
 
Posts: 18 since Jul 2014
Thanks: 16 given, 1 received

I fixed it.

Vars:
VolUP ( 0 ),
VolDOWN ( 0 );

VolUP = upticks;
VolDOWN = Downticks;

if Volume > VOVO
and
VolUP > VolDOWN
then
begin
buy ( "buy") Cts contracts next bar at market ;
MarketPosition = true;
end;

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

From looking at your code it might be possible you are not getting the correct Volume information when using "Volume" as a reserved word. Take a look at the build in Volume indicator. You should check for the bartype and either use TIcks or Volume depending on the Bar type you are using, as there is a difference for daily bars or minute and lower.

Regards,
ABCTG


honoluluhustler View Post
I fixed it.

Vars:
VolUP ( 0 ),
VolDOWN ( 0 );

VolUP = upticks;
VolDOWN = Downticks;

if Volume > VOVO
and
VolUP > VolDOWN
then
begin
buy ( "buy") Cts contracts next bar at market ;
MarketPosition = true;
end;


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)
Honolulu + Hawaii / USA
 
 
Posts: 18 since Jul 2014
Thanks: 16 given, 1 received

it was in ticks. Thanks for mentioning that!

Reply With Quote


futures io Trading Community Platforms and Indicators MultiCharts > can i write a line of code that if the up volume > down volume then ....


Last Updated on August 5, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

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

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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