Noob alert! Query regarding entering variable - MultiCharts | futures io social day trading
futures io futures trading


Noob alert! Query regarding entering variable
Updated: Views / Replies:1,408 / 14
Created: by saj1011 Attachments:2

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 2  
 
Thread Tools Search this Thread
 

Noob alert! Query regarding entering variable

  #11 (permalink)
Elite Member
London, United Kingdom
 
Futures Experience: Intermediate
Platform: MetaTrader
Favorite Futures: EUR/USD
 
Posts: 20 since Feb 2014
Thanks: 2 given, 1 received

help!

Hi prob with code again, what is wrong? i copied it exactly from forum. gettin this error:

Study: "BM_MoneyMaker" (Signal)
Please wait ....
------ Compiled with error(s): ------
unverified function is used
line 51, column 7
causal study: jthma (Function)

code:

inputs:

smalength ( 200 ),

emalength ( 100 ),

hmalength ( 34 ),

target1 ( 12 ),

target2 ( 12 ),

target3 ( 20 ),

stopsize ( 12 ),

BE2 ( 0 ), // 0=false, 1=true

BE3 ( 0 ); // 0=false, 1=true



vars:

TickSize ( MinMove / PriceScale ),

smav ( 0 ),

emav ( 0 ),

hmav ( 0 ),

t1 ( Target1 * TickSize ),

t2 ( (Target1 + Target2) * TickSize ),

t3 ( (Target1 + Target2 + Target3) * TickSize ),

st1 ( 0 ),

st2 ( 0 ),

st3 ( 0 );



smav = Average(Close, smalength);

emav = XAverage(Close, emalength);

hmav = jtHMA(Close, hmalength);





// open new positions



if MarketPosition = 0 then begin



if smav > smav[1] and emav > emav[1] and hmav > hmav[1] then begin



Buy ("Enter long") 3 Contracts Next Bar At Market;



end;



if smav < smav[1] and emav < emav[1] and hmav < hmav[1] then begin



SellShort ("Enter short") 3 Contracts Next Bar At Market;



end;

end;



// manage open orders



if MarketPosition = 1 then begin



st1 = EntryPrice - (stopsize * TickSize);

st2 = iff(BE2 = 1, EntryPrice, EntryPrice - (stopsize * TickSize));

st3 = iff(BE3 = 1, EntryPrice, EntryPrice - (stopsize * TickSize));



if CurrentContracts = 1 then begin

Sell ("Exit l3-c1 Target") 1 Contracts Next Bar At (EntryPrice + t3) Limit;

Sell ("Exit l3-c1 Stop") 1 Contracts Next Bar At st3 Stop;

end;



if CurrentContracts = 2 then begin

Sell ("Exit l2-c2 Target") 1 Contracts Next Bar At (EntryPrice + t2) Limit;

Sell ("Exit l2-c2 Stop") 1 Contracts Next Bar At st2 Stop;

Sell ("Exit l3-c2 Target") 1 Contracts Next Bar At (EntryPrice + t3) Limit;

Sell ("Exit l3-c2 Stop") 1 Contracts Next Bar At st3 Stop;

end;



if CurrentContracts = 3 then begin

Sell ("Exit l1-c3 Target") 1 Contracts Next Bar At (EntryPrice + t1) Limit;

Sell ("Exit l1-c3 Stop") 1 Contracts Next Bar At st1 Stop;

Sell ("Exit l2-c3 Target") 1 Contracts Next Bar At (EntryPrice + t2) Limit;

Sell ("Exit l2-c3 Stop") 1 Contracts Next Bar At st2 Stop;

Sell ("Exit l3-c3 Target") 1 Contracts Next Bar At (EntryPrice + t3) Limit;

Sell ("Exit l3-c3 Stop") 1 Contracts Next Bar At st3 Stop;

end;

end;



if MarketPosition = -1 then begin



st1 = EntryPrice + (stopsize * TickSize);

st2 = iff(BE2 = 1, EntryPrice, EntryPrice + (stopsize * TickSize));

st3 = iff(BE3 = 1, EntryPrice, EntryPrice + (stopsize * TickSize));



if CurrentContracts = 1 then begin

BuyToCover ("Exit s3-c1 Target") 1 Contracts Next Bar At (EntryPrice - t3) Limit;

BuyToCover ("Exit s3-c1 Stop") 1 Contracts Next Bar At st3 Stop;

end;



if CurrentContracts = 2 then begin

BuyToCover ("Exit s2-c2 Target") 1 Contracts Next Bar At (EntryPrice - t2) Limit;

BuyToCover ("Exit s2-c2 Stop") 1 Contracts Next Bar At st2 Stop;

BuyToCover ("Exit s3-c2 Target") 1 Contracts Next Bar At (EntryPrice - t3) Limit;

BuyToCover ("Exit s3-c2 Stop") 1 Contracts Next Bar At st3 Stop;

end;



if CurrentContracts = 3 then begin

BuyToCover ("Exit s1-c3 Target") 1 Contracts Next Bar At (EntryPrice - t1) Limit;

BuyToCover ("Exit s1-c3 Stop") 1 Contracts Next Bar At st1 Stop;

BuyToCover ("Exit s2-c3 Target") 1 Contracts Next Bar At (EntryPrice - t2) Limit;

BuyToCover ("Exit s2-c3 Stop") 1 Contracts Next Bar At st2 Stop;

BuyToCover ("Exit s3-c3 Target") 1 Contracts Next Bar At (EntryPrice - t3) Limit;

BuyToCover ("Exit s3-c3 Stop") 1 Contracts Next Bar At st3 Stop;

end;



end;



jtHMA function which i copied in separately:


{jtHMA - Hull Moving Average Function}

{Author: Atavachron}

{May 2005}



Inputs: price(NumericSeries), length(NumericSimple);

Vars: halvedLength(0), sqrRootLength(0);



{

Original equation is:

---------------------

waverage(2*waverage(close,period/2)-waverage(close ,period), SquareRoot(Period)

Implementation below is more efficient with lengthy Weighted Moving Averages.

In addition, the length needs to be converted to an integer value after it is halved and

its square root is obtained in order for this to work with Weighted Moving Averaging

}



if ((ceiling(length / 2) - (length / 2)) <= 0.5) then

halvedLength = ceiling(length / 2)

else

halvedLength = floor(length / 2);



if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then

sqrRootLength = ceiling(SquareRoot(length))

else

sqrRootLength = floor(SquareRoot(length));



Value1 = 2 * WAverage(price, halvedLength);

Value2 = WAverage(price, length);

Value3 = WAverage((Value1 - Value2), sqrRootLength);



jtHMA = Value3;

Reply With Quote
 
  #12 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

saj1011,

when you post code, please wrap code tags around it. This helps a lot in the visibility.

When you say "jtHMA function which i copied in separately" did you copy it into the same signal code or did you create a separate function?

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #13 (permalink)
Elite Member
London, United Kingdom
 
Futures Experience: Intermediate
Platform: MetaTrader
Favorite Futures: EUR/USD
 
Posts: 20 since Feb 2014
Thanks: 2 given, 1 received

reply


separate function.

Reply With Quote
 
  #14 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

saj1011,

I'll upload the code as PLA later, this should work fine then.

Regards,
ABCTG

Reply With Quote
 
  #15 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

saj1011,

here you go. This is the exact code like you posted it in this thread.
I did not test it or change it, just took what you posted and pasted it within the signal
and function, compiled it and exported it for you.

Regards,
ABCTG

Attached Files
Register to download File Type: pla BM_MoneyMaker.pla (13.3 KB, 11 views)
Reply With Quote

Reply



futures io > > > > Noob alert! Query regarding entering variable

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
SuperTrendU11 Strategy Query sburtt NinjaTrader Programming 14 May 29th, 2013 06:34 PM
Three Line Break on FX Query Zhorny MultiCharts 1 November 21st, 2012 06:12 AM
Direct query for account balance? drmartell Reviews of Brokers and Data Feeds 4 November 15th, 2012 02:01 PM
Using Excel to query MySQL database Big Mike The Elite Circle 3 November 7th, 2012 08:40 AM
Database - A Simple Query ab456 Traders Hideout 1 October 15th, 2011 03:04 PM


All times are GMT -4. The time now is 01:06 PM.

Copyright © 2017 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
Page generated 2017-12-16 in 0.13 seconds with 20 queries on phoenix via your IP 54.91.38.173