NexusFi: Find Your Edge


Home Menu

 





LIMIT/STOP Order instad of SL/TP


Discussion in MultiCharts

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




 
Search this Thread
  #1 (permalink)
no erocla
turin italy
 
Posts: 96 since May 2013
Thanks Given: 43
Thanks Received: 4

Hi guys, my question is very simple:

there s a way to set stoploss and profittarget using STOP and LIMIT order ?

for example i would like to do something like this:


if ( marketposition = 0 and condition4 and condition5) then BEGIN

buy ("Long EURUSD") 100000 contracts next bar at open;
sell ("sell SL 1 ") 100000 contracts next bar at C-stoploss1 stop;
sell ("sell TP 1 ") 50000 contracts next bar at C+takeprofit1 limit;
sell ("sell TP 2 ") 50000 contracts next bar at C+takeprofit2 limit;
END;

Using 1 stoploss and 2 takeprofit.

Thank you very much about all answer

No Erocla


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
May 26 Deadline Dies at 7.5% as US Strikes Iran During C …
Prediction Markets & Event Contracts
CPI Eve: Fed Hike Odds Hold at 52% for the First Time, I …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
Bond Market Rout -- Worst Week Since Russias 2022 Invasi …
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

Yes, you can do this. However with your MC would close out the whole position at your target and ignore the contracts.
You just need to slightly modify your code this this and it should work fine:
 
Code
if ( marketposition = 0 and condition4 and condition5) then BEGIN

buy ("Long EURUSD1") 50000 contracts next bar at open;
buy ("Long EURUSD2") 50000 contracts next bar at open;
end;
if MarketPosition > 0 then
begin
sell ("sell SL 1 ") all contracts next bar at C-stoploss1 stop;

sell ("sell TP 1 ") 50000 contracts from Entry ("Long EURUSD1") next bar at C+takeprofit1 limit;
sell ("sell TP 2 ") 50000 contracts from Entry ("Long EURUSD1") next bar at C+takeprofit2 limit;
END;
You might have to change some settings to allow more than trade per bar or in the same direction if you only see one entry. Another thing to consider is using intrabar order generation so your stops and targets are available directly after the entry.

Regards,
ABCTG


Follow me on X Reply With Quote
Thanked by:
  #3 (permalink)
no erocla
turin italy
 
Posts: 96 since May 2013
Thanks Given: 43
Thanks Received: 4



ABCTG View Post
Yes, you can do this. However with your MC would close out the whole position at your target and ignore the contracts.
You just need to slightly modify your code this this and it should work fine:
 
Code
if ( marketposition = 0 and condition4 and condition5) then BEGIN

buy ("Long EURUSD1") 50000 contracts next bar at open;
buy ("Long EURUSD2") 50000 contracts next bar at open;
end;
if MarketPosition > 0 then
begin
sell ("sell SL 1 ") all contracts next bar at C-stoploss1 stop;

sell ("sell TP 1 ") 50000 contracts from Entry ("Long EURUSD1") next bar at C+takeprofit1 limit;
sell ("sell TP 2 ") 50000 contracts from Entry ("Long EURUSD1") next bar at C+takeprofit2 limit;
END;
You might have to change some settings to allow more than trade per bar or in the same direction if you only see one entry. Another thing to consider is using intrabar order generation so your stops and targets are available directly after the entry.

Regards,
ABCTG

Thank you very much,

what happen using IOG ? i never used it before.

Close is Tick or still remain close ?
My systems works on close price, i've to "ref" them to 1 bar ago ? (Close[1] , atr(14)[1] etc..).

Thank you again !

No Erocla.


Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

You are welcome. IOG is a more complex task when dealing with signals. For example orders that are specified at "next bar" become available at the next tick. So when you specify
 
Code
Buy next bar Close limit;
This would mean send a limit order for the next tick using the value for close of the current tick.

If you haven't used it before there probably is no reason for that with your signal then.

Regards,

ABCTG


no erocla View Post
Thank you very much,

what happen using IOG ? i never used it before.

Close is Tick or still remain close ?
My systems works on close price, i've to "ref" them to 1 bar ago ? (Close[1] , atr(14)[1] etc..).

Thank you again !

No Erocla.


Follow me on X Reply With Quote
Thanked by:




Last Updated on December 3, 2013


© 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