NexusFi: Find Your Edge


Home Menu

 





question on stop orders in algo


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 Ssjaznguy 
la puente, California
 
Experience: None
Platform: NinjaTrader
Trading: Es
Posts: 30 since Oct 2018
Thanks Given: 7
Thanks Received: 1

calculatemode = tick
stop placement = 1 tick above or below prior bar high/low depending on direction

My issue is that I have error messages whenever stop price is below market price, or vis versa, how can I prevent this message from popping up (sometimes 500 errors before order get in at the price I want)

I still want my algo to attempt to get in with a stop order as the tick move within the current bar still.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Datafeed for Atas
Platforms and Indicators
Daytrading to swingtrading
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
  #2 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,581 since Oct 2009
Thanks Given: 4,267
Thanks Received: 6,212


Ssjaznguy View Post
calculatemode = tick
stop placement = 1 tick above or below prior bar high/low depending on direction

My issue is that I have error messages whenever stop price is below market price, or vis versa, how can I prevent this message from popping up (sometimes 500 errors before order get in at the price I want)

I still want my algo to attempt to get in with a stop order as the tick move within the current bar still.

before placing your order check the ask or bid price
if (GetCurrentAsk() <= High[1] + 1 * TickSize) the stop order can be safely placed
if (GetCurrentBid() >= Low[1] - 1 * TickSize) the stop order can be safely placed


Reply With Quote
Thanked by:
  #3 (permalink)
 Ssjaznguy 
la puente, California
 
Experience: None
Platform: NinjaTrader
Trading: Es
Posts: 30 since Oct 2018
Thanks Given: 7
Thanks Received: 1


I currently have it the same without the "=". This issue triggers mostly on "traps" after I analyze it more, I am wondering more if there is a place in ninjatrader where I can turn of that particular error message (500+ error message window really drain the comp resource).


Started this thread Reply With Quote
  #4 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,581 since Oct 2009
Thanks Given: 4,267
Thanks Received: 6,212


Ssjaznguy View Post
I currently have it the same without the "=". This issue triggers mostly on "traps" after I analyze it more, I am wondering more if there is a place in ninjatrader where I can turn of that particular error message (500+ error message window really drain the comp resource).

If you can post part of your code and the interval you use maybe we can suggest a more appropriate way to go.


Reply With Quote
  #5 (permalink)
 Ssjaznguy 
la puente, California
 
Experience: None
Platform: NinjaTrader
Trading: Es
Posts: 30 since Oct 2018
Thanks Given: 7
Thanks Received: 1

EntryLong = (High[1] + 1 * TickSize);
StopLossLong = (MIN(Low, 4)[0] - (StopLoss * TickSize));
//Enter Long

if (TDUPriceAction1.TrapLong[0] == 2 && TDUPriceAction1.BarSizeInTicks[1] <= RiskTick && Close[0] >= KAMA1[0] && CCI1[0] <= CCIIndex && (amaMACDBBLines1.Trend[0] == 1 || amaMACDBBLines1.Trend[0] == 2) && EntryLong > GetCurrentAsk())
{
BreakEvenTrigger = true;
SetStopLoss("Long1", CalculationMode.Price, StopLossLong, false);
SetStopLoss("Long2", CalculationMode.Price, StopLossLong, false);
EnterLongStopMarket(Convert.ToInt32(DefaultQuantity), EntryLong, "Long1");
EnterLongStopMarket(Convert.ToInt32(DefaultQuantity), EntryLong, "Long2");
}


Started this thread Reply With Quote




Last Updated on April 16, 2022


© 2026 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 - Downloads - Top
no new posts