NexusFi: Find Your Edge


Home Menu

 





Strategy Condition Logic >> my wetware


Discussion in NinjaTrader

Updated
    1. trending_up 2,780 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?
Exit Strategy
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 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