NexusFi: Find Your Edge


Home Menu

 





Stop / Profit Calculations


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
joeyjoeyjoeeey
Minneapolis
 
Posts: 4 since Nov 2016
Thanks Given: 1
Thanks Received: 0

Hello Traders!

I am fairly new to EasyLanguage, but programming a system to buy based on moving average/volume. I have a block of 5 boolean logic statements that are successive. After the last boolean (i.e. all the filters are true) I have a buy statement which works fine.

My problem is my setstoploss() and setprofittarget() statements. I first put them inside logic blocks (i.e. if marketposition = 1 then setstoploss(1000) but I was told to leave these statements outside of logic blocks and they will only create orders if I have a position.

Now I have my setstoploss and setprofittarget statements at the very end of my program (outside of any logic blocks) and when I get my buy orders filled I get my stop/profit orders in the queue but they constantly are updated as if they are being calculated on the current price as opposed to the entryprice. I am looking at the Active Orders tab and my stop/profit taking orders keep recalculating/canceling the previous order and creating new ones.

Does this have anything to do with the logic I have above my stop/profit orders? It doesn't appear that my buy orders are constantly being updated (part of the logic is that I can only have one position on, so if currentshares > 0, exit logic).

Any help would be greatly appreciated. Thanks for your time and happy trading!


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
CFTC Approves First US Bitcoin Perpetual Futures -- Kals …
Traders Hideout
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642


joeyjoeyjoeeey,

it sounds like your code changes the values for the stops and targets and that's why the orders are getting updated. Normally they should stay in place once send. Without knowing your code for the stop and target it's hard to tell, though.

When you use Tradestation the explanation could also be that the stop and target can't be active at the same time and Tradestation switches between them i.e. also activates the one that is closer to the current market.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:




Last Updated on November 21, 2016


© 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