• Ask a question
  • Spaces
    • TT® Platform
    • Autospreader®
    • Autotrader™
    • Charting & Analytics
    • Options
    • ADL®
      • ADL Samples
    • RTD
    • APIs
      • TT .NET SDK
      • TT API & XT API
      • TT REST API
    • Cryptocurrencies
    • Topics
    • Questions
    • Articles
    • Ideas
    • Badges
  • Sign in
  • Home /
  • ADL® /
avatar image
0
Question by mcai6 · Nov 28, 2016 at 10:02 PM · Order Types

Why there is a negative position when I stop loss by placing sell-order?

Hi @Damon, I'am Manlin and just calling ask for help. I am beginner and just building a simple scalping algo but facing an issue that are causing us not be hedged.

The logic of buy-side order is correct I think. And after the buy-order filled, there are two situation trigger the Sell-order filled to lose my position, one is to sell it 3 ticks above my long position, the other is to close position with market price in order to stop loss. But the problem is the position becomes negative after a few minutes running. Since the logic is set as either sell 3 ticks higher or sell at market price, just want to close the existing position, so it should not have negative position there.

I attach the algo below, could you help me take a look?
Thank you!

Whole Algo:


Close position:

close-position.png (100.9 kB)
whole.png (105.2 kB)
Comment
Add comment
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Damon · Nov 28, 2016 at 10:16 PM

Hello @mcai6

Can you please show me what you have for your ENTRY Buy Side logic management group block. Also, how are you populating the Entry Order Qty? Do you have internal conditional logic inside your DOB?

Regarding your EXIT Hedge Logic..... I would try patterning it after this sample of a OCO type Library Block logic:\

Link: https://community.tradingtechnologies.com/article...

A few other questions to ask:
- Why are you using a Value Accumulator Block as a pass through function to trigger the Buy DOB? You could use the discrete message from the Generator Block to do the same thing.
- Why are you not placing your DOB inside your BUY side order management virtualized group block? This could pose some difficulties downstream in your logic with keeping track of all the possible child order submissions.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mcai6 · Dec 06, 2016 at 04:19 PM

Hello @Damon, Thank you so much. The sample of the OCO type Library Block logic is very helpful. I simply followed the Link, and now the problem about Hedge and Exit quantity is fixed.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Damon · Dec 07, 2016 at 05:09 PM

Always glad to help out.

Comment
Add comment · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Community

Ask questions and share ideas about the TT® and X_TRADER® platforms.

First time here? See our Getting Started Guide and FAQs.

Follow

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Single Order Container delete functionality 1 Answer

Help to understand Order Block vs Discrete Order Block 2 Answers

ADL Multiple Exit Orders – Profit Target, Break Even and Stop Loss Order Managment 2 Answers

How do I program ADL to delete my working order if I become "alone" at that price? 1 Answer

Can Stop Orders be Triggered by A Quantity Threshold as well as Price 9 Answers

Trading Technologies Home - Legal - Privacy - Contact

© 2017 Trading Technologies International, Inc. All rights reserved.

Powered by AnswerHub

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • TT® Platform
  • Autospreader®
  • Autotrader™
  • Charting & Analytics
  • Options
  • ADL®
    • ADL Samples
  • RTD
  • APIs
    • TT .NET SDK
    • TT API & XT API
    • TT REST API
  • Cryptocurrencies
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges