Strategy Condition Logic >> my wetware - futures io
futures io futures trading



Strategy Condition Logic >> my wetware


Discussion in NinjaTrader

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

Strategy Condition Logic >> my wetware

(login for full post details)
  #1 (permalink)
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 received

Greets!

I am trying to add this type of condition to the condition 'if' statement of the strategy, and while it does compile, there are no results generated when running a backtest:

SwingGap.SwingHigh [0] - SwingGap.SwingLow [0] > 14

In other words I dont want to take a trade if the range between the current swing high and low is less that a predetermined amount. Sorry, I am typing from a computer where the strategy is not installed: I can post the rest of the code later if it is helpful.

I have tried private boll statements but it is not accepted that way either. I must be missing a step that is obvious to some ... not to me though.

Can someone please help me out?

Thanks,
Jon

Started this thread Reply With Quote
The following user says Thank You to Trader.Jon for this post:

Can you help answer these questions
from other members on futures io?
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
Indicators for pair trading MES and M2K
Platforms and Indicators
ZigZag with Depth and Backstep
EasyLanguage Programming
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
 
 
(login for full post details)
  #3 (permalink)
Florida
 
Experience: Intermediate
Platform: NT7
Trading: CL, NQ, NG
 
Posts: 469 since Jun 2009
Thanks: 1,401 given, 402 received


It might take more parentheses or creating a double value of the High-Low

try:

 
Code
if ((SwingGap.SwingHigh [0] - SwingGap.SwingLow [0]) > 14)
{
do whatever you want here
}
or

 
Code
"variables"
private double diff = 0;
 
"onbarupdate"
diff = SwingGap.SwingHigh [0] - SwingGap.SwingLow [0];
if (diff > 14)
{
 
}
not tested...good luck
kz

Reply With Quote
The following user says Thank You to zeller4 for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Strategy Condition Logic >> my wetware


Last Updated on May 24, 2010


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