NexusFi: Find Your Edge


Home Menu

 





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


Discussion in MultiCharts

Updated
    1. trending_up 1,860 views
    2. thumb_up 5 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

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

  #1 (permalink)
honoluluhustler
Honolulu + Hawaii / USA
 
Posts: 18 since Jul 2014
Thanks Given: 16
Thanks Received: 1

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] [img]https://farm4.staticflickr.com/3924/14830463652_29e8768154_o.png[/img] updown volume ratio by tracyrollins92, on Flickr[/IMG]

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
50 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #2 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901


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] [img]https://farm4.staticflickr.com/3924/14830463652_29e8768154_o.png[/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 NexusFi Trade Journal Reply With Quote
The following 3 users say Thank You to Hulk for this post:
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


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:
  #4 (permalink)
honoluluhustler
Honolulu + Hawaii / USA
 
Posts: 18 since Jul 2014
Thanks Given: 16
Thanks Received: 1

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
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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:
  #6 (permalink)
honoluluhustler
Honolulu + Hawaii / USA
 
Posts: 18 since Jul 2014
Thanks Given: 16
Thanks Received: 1

it was in ticks. Thanks for mentioning that!

Reply With Quote





Last Updated on August 5, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts