NexusFi: Find Your Edge


Home Menu

 





Scaling in contracts


Discussion in MultiCharts

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




 
Search this Thread

Scaling in contracts

  #1 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9

So I'm trying to create a strategy that scales in and out. I've managed to figure out how to partially close out a position. However, I'm struggling with the code to scale in. I was under the impression that you could simple use the Buy or SellShort command and use different labels for the various positions. however, it seems that these orders are being ignored.

I did find the reserve word CHANGEMARKETPOSITION ... is that the way to do it? The problem I have is that when I read the description in the MC keyword reference, the example used is

Example

If MarketPosition = 2 then ChangeMarketPosition (-2,100,"LX")

Will place close order with the name "LX" and the price 100 if current marketposition =2

I thought Marketposition could only be 1, 0, or -1????

Please chime in. Thanks

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
25 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

Sinatra Fan,

the reserved words buy and sellshort work fine for pyramiding. However, by default Multicharts will only take one entry in the same direction and need to adjust the position limit settings on "Properties" tab of the "Strategy Properties" dialog.

Regards,

ABCTG


Sinatra Fan View Post
So I'm trying to create a strategy that scales in and out. I've managed to figure out how to partially close out a position. However, I'm struggling with the code to scale in. I was under the impression that you could simple use the Buy or SellShort command and use different labels for the various positions. however, it seems that these orders are being ignored.

I did find the reserve word CHANGEMARKETPOSITION ... is that the way to do it? The problem I have is that when I read the description in the MC keyword reference, the example used is

Example

If MarketPosition = 2 then ChangeMarketPosition (-2,100,"LX")

Will place close order with the name "LX" and the price 100 if current marketposition =2

I thought Marketposition could only be 1, 0, or -1????

Please chime in. Thanks


Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


Thanks ABC...

I really appreciate your help. Can I ask you then what is the purpose of the reserve word CHANGEMARKETPOSITION? Thanks

Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

Sinatra Fan,

it is used for changing the market position on the chart without actually issuing orders. Take a look at the built-in "!From Broker To Strategy MP Synchronizer!" for an example of synchronizing the
chart position to the broker position.

Regards,

ABCTG



Sinatra Fan View Post
Thanks ABC...

I really appreciate your help. Can I ask you then what is the purpose of the reserve word CHANGEMARKETPOSITION? Thanks


Follow me on Twitter Reply With Quote
  #5 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


ABCTG View Post
Sinatra Fan,

it is used for changing the market position on the chart without actually issuing orders. Take a look at the built-in "!From Broker To Strategy MP Synchronizer!" for an example of synchronizing the
chart position to the broker position.

Regards,

ABCTG

Thanks ABC... sorry to keep leaning on you, but I have another question; maybe two

So, I started another thread about changing names on trades. Can you confirm my belief that CME futures trades are closed on a FIFO (First In First Out) basis? I believe they are and if so, this can create a bit of a problem programming continual scaling in and out. That would be question 1.

Here's question 2: Let's assume for a minute that I'm right about the FIFO issue. Does it really matter coding wise? Let me throw a scenario at you. So let's assume I go long 4 different times in the ES at 5 contracts each time and now I am long 20 ES. I call them L1 - L4. If I close out 10 of those contracts, but tell it to close out L3 and L4, will that be a problem? I'm hoping it's not and that in reality, the contracts in L1 and L2 will be closed as they were first in. Let me know your thoughts. Thanks again for all your help.

Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

Sinatra Fan,

based on your example it appears you are mixing the internal strategy trades (i.e. what the strategy "sees") and what happens at the exchange.

If you close out the last filled strategy trade first within your strategy, then the strategy will see this and be aware of that, even if the exchange filled you on a FIFO basis.

Regards,

ABCTG


Sinatra Fan View Post
Thanks ABC... sorry to keep leaning on you, but I have another question; maybe two

So, I started another thread about changing names on trades. Can you confirm my belief that CME futures trades are closed on a FIFO (First In First Out) basis? I believe they are and if so, this can create a bit of a problem programming continual scaling in and out. That would be question 1.

Here's question 2: Let's assume for a minute that I'm right about the FIFO issue. Does it really matter coding wise? Let me throw a scenario at you. So let's assume I go long 4 different times in the ES at 5 contracts each time and now I am long 20 ES. I call them L1 - L4. If I close out 10 of those contracts, but tell it to close out L3 and L4, will that be a problem? I'm hoping it's not and that in reality, the contracts in L1 and L2 will be closed as they were first in. Let me know your thoughts. Thanks again for all your help.


Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


ABCTG View Post
Sinatra Fan,

based on your example it appears you are mixing the internal strategy trades (i.e. what the strategy "sees") and what happens at the exchange.

If you close out the last filled strategy trade first within your strategy, then the strategy will see this and be aware of that, even if the exchange filled you on a FIFO basis.

Regards,

ABCTG

Not sure I understand what you are saying. Are you saying that 1) I am correct that in reality, the exchange will close out contracts on a FIFO? and 2) that the strategy will end up closing all the contracts since it didn't close out L3 & L4? Not sure I understand what you're saying when you said "then the strategy will see this and be aware of that".

Started this thread Reply With Quote
  #8 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

Sinatra Fan,

my point is that it might not matter for your strategy development if the exchange fills your contracts on a FIFO basis. You can tie your exits to respective strategy entries and this is what the strategy detects and is aware of.

Regards,

ABCTG


Sinatra Fan View Post
Not sure I understand what you are saying. Are you saying that 1) I am correct that in reality, the exchange will close out contracts on a FIFO? and 2) that the strategy will end up closing all the contracts since it didn't close out L3 & L4? Not sure I understand what you're saying when you said "then the strategy will see this and be aware of that".


Follow me on Twitter Reply With Quote
Thanked by:
  #9 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


ABCTG View Post
Sinatra Fan,

my point is that it might not matter for your strategy development if the exchange fills your contracts on a FIFO basis. You can tie your exits to respective strategy entries and this is what the strategy detects and is aware of.

Regards,

ABCTG

Thanks my friend. I think that it good news. I'll let you know when I'm done with this project.

Started this thread Reply With Quote




Last Updated on April 30, 2021


© 2024 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 - Privacy Policy - Downloads - Top
no new posts