NexusFi: Find Your Edge


Home Menu

 





CHECK THIS OUT: Real-time position checker, code included!


Discussion in MultiCharts

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




 
Search this Thread

CHECK THIS OUT: Real-time position checker, code included!

  #1 (permalink)
jan123321
Prague/ Czech Republic
 
Posts: 7 since Sep 2013
Thanks Given: 1
Thanks Received: 3

Hello,

I made a small utility which should help me to monitor strategies in real time. Please, I would appreciate any comments or recommendations.

How it's supposed to work:

1.) Add to your strategies following setting up of GVs:

GVSetNamedFloat(Getstrategyname+"_TT", Totaltrades);
GVSetNamedFloat(Getstrategyname+"_MP", Marketposition );
GVSetNamedFloat(Getstrategyname+"_BS", MarketPosition_at_Broker_for_The_Strategy );
GVSetNamedFloat(Getstrategyname+"_MP_B", MarketPosition_at_Broker);
GVSetNamedFloat(Getstrategyname+"_CC", CurrentContracts);

2.) Inputs to indicator are names of strategies which we would like to monitor on appropriate symbol. Indicator should pain bars based on position on chart, also it should alert user when following condition are not met:

I.) Internal check (Check Strategy Side) = no global variables needed
If TT = TT[1] and MP_BS <> MP[1]
then MisMatch = TRUE else MisMatch = FALSE;

II.) External check (Monitor number of contracts on symbol) = get numbers of contracts from each strategy and their summation should be equal to "MarketPosition_at_Broker" (MP_B).
Summ = CC1 + CC2 + CC3;
If Summ <> MP_B
then MisMatch = TRUE else MisMatch = FALSE;


Further notes:
* Using brokers data, so no further strategies should run on account for that symbol, also wont be working in back-test
* Can be easily coded for more strategies than 3 on symbol
* Working only for one symbol
* Not tested for scaling
* The most problematic part I think is a variable "flag" which I was pushed to use in order to minimize the number of warnings per bar due inside bars. As other chart will have a signals in different times, variables can change asynchronously with current chart, so that can cause problems and "falsely" trigger alert conditions. Any tip how to work it out and not to eliminate other ticks on bar appreciated!
* I tried the code only on range bars.


I appreciate any suggestion or potential problems notice (different conditions, potential threads, perhaps ideas when this condition do not work etc.).


Thank you,
John

Attached Files
Elite Membership required to download: Checker_15_08_07.pla
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Exit Strategy
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #2 (permalink)
jan123321
Prague/ Czech Republic
 
Posts: 7 since Sep 2013
Thanks Given: 1
Thanks Received: 3

Please find checker indicator with random strategy to illustrate how GV should be defined...

Code remakes, because of function "CurrentContract" return absolute number of contracts not like MP_at_broker function which returns +/- based on position.

Please, do not forget to change inputs in indicator "name and other" to defined name in strategy! In this concrete example, name of strategy to start downloading appropriate GV is: "name+_TF_Rand". So get it working the input in indicator must be "TS_TF_Rand". That is going to work only for one strategy on symbol. If you want to include other strategies, other strategies must also save position info and names of those variables must be set in inputs of CHECKER indicator.

Any remarks appreciated, thank you.

Attached Files
Elite Membership required to download: CHECKER_2_bar.pla
Reply With Quote
Thanked by:




Last Updated on August 11, 2015


© 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