NexusFi: Find Your Edge


Home Menu

 





Strategy Condition Logic >> my wetware


Discussion in NinjaTrader

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




 
Search this Thread

Strategy Condition Logic >> my wetware

  #1 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

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
Thanked by:

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
Quant vue
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
72 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
27 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
16 thanks
  #3 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404


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
Thanked by:




Last Updated on May 24, 2010


© 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