NexusFi: Find Your Edge


Home Menu

 





tracking each contract's profit target and stop loss


Discussion in MultiCharts

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




 
Search this Thread
  #1 (permalink)
sunsun
hong kong
 
Posts: 6 since May 2013
Thanks Given: 1
Thanks Received: 1

Hi, I'm running a simple program with Multicharts.
The basic logic is that I will first take a long position and after I'm in the money for about 50 points, I accumulate my position by taking another long position. I am having trouble setting an individual stop loss and profit target for each contract. Below is the code I wrote but with no success so far. I wonder if my logic is wrong. Feel free to comment. Thanks

code:

if condition then
buy (1st) at Market;

if current price - entryprice > 50 then

buy (2nd) at Market

if currentcontract =1 then
set profit1
set stop1

if currentcontract = 2 then
set profit1
set stop1
set profit2
set stop2


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
The Pivot Point 113.6³ — Navigating the Prediction of …
26 thanks
Sober Journey With S&P
17 thanks
The Confluence Meter: A Multi-Layered Signal Framework B …
11 thanks
NT8 color choices
10 thanks
Volume Indicators
7 thanks
  #2 (permalink)
 quantarb 
Wayne, NJ USA
 
Experience: Intermediate
Platform: Multicharts, Deltix DCS
Broker: Interactive Brokers/IQ Feed
Trading: ETF Options
Posts: 41 since Oct 2012
Thanks Given: 7
Thanks Received: 38


sunsun View Post
Hi, I'm running a simple program with Multicharts.
The basic logic is that I will first take a long position and after I'm in the money for about 50 points, I accumulate my position by taking another long position. I am having trouble setting an individual stop loss and profit target for each contract. Below is the code I wrote but with no success so far. I wonder if my logic is wrong. Feel free to comment. Thanks

code:

if condition then
buy (1st) at Market;

if current price - entryprice > 50 then

buy (2nd) at Market

if currentcontract =1 then
set profit1
set stop1

if currentcontract = 2 then
set profit1
set stop1
set profit2
set stop2


if condition1 then
begin
Buy ("Entry 1") 1 contract next bar at market;
end;

if MarketPosition * Current Shares =1 then
begin
Buy("Entry 2") 1 contract next bar at EntryPrice +50 Stop;
end;

if MarketPosition =1 then
begin
Sell from ("Entry 1") next bar at ProfitTarget1 Limit;
Sell from ("Entry 1") next bar at Stop1 Stop;
Sell from ("Entry 2") next bar at ProfitTarget2 Limit;
Sell from ("Entry 2") next bar at Stop2 Stop;
end;

With your current code you will be buying another contract for every 50 point profit...


Reply With Quote
Thanked by:




Last Updated on May 6, 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