MultiCharts Automated trading

Discussion in 'Automated Trading' started by MarkBrown, Oct 9, 2022.

  1. Today's software is damn reliable....but the datafeeds are not. That will cause a fail.
     
    #41     Oct 19, 2022
    MarkBrown likes this.
  2. So we have about 3 different options with MC:
    1) manual trading
    2) semi-automated trading (Require Trade Confirmation = On)
    3) fully-automated trading

    Unfortunately, with #2, you can't specify confirmation for both entries and exits independently.
    I have put in an enhancement request for this.
    It would be great if the signal puts you into the trade automatically and then you manage the exit manually....and vise-versa.
     
    #42     Oct 20, 2022
    MarkBrown likes this.
  3. ZBZB

    ZBZB

    Now TradingView, from the same company, has a $3 billion valuation they might not be in a rush to fix it.
     
    #43     Oct 20, 2022
    MarkBrown likes this.
  4. Which company ?
     
    #44     Oct 20, 2022
  5. VSTscalper

    VSTscalper

    About your - Classic and Standard Range Bars - I have NEVER seen "fake price bars" in MC - and I have been using MC for a many years. Also - I just consider Range Bars - as Range Bars - NOT Classic or Standard. Are you going Full Auto - when you see the bars form - and "that price tick it traded disappear"?

    For me - I see absolutely NO advantage to using Kase Range Bars. As far as my Algos goes - it really doesn't matter what type of bar - could be a Tick chart - or Minute - or other types - my Code doesn't care.

    I have a Net Daily Goal in Dollars - that I try to make in a 2 hour period. I just set the Time to trade - so it only trades during those 2 hours. I do have some Code - that can be Set - to the Times you mentioned - and trade only during those Time Periods - really NOT complicated. For me - I have other things to do during the day - totally unrelated to trading (mainly related to Family - Grandkids) - so many years ago - I set the 2 hour Time Period. As I get older - I try to use my time - for things that are more important to me - than Trading. That may sound crazy - saying this in a Trading Forum.

    These days - I mainly trade the ES and MES - using a 7 Tick Range Bar - I keep things as Simple as possible. I won't go into detail here - but it is Simple.

    I also have a one more Workspace - with an Algo - currently for the NQ - using a 200 Tick Range Bar. The NQ can really be a Fast mover. The main reason for this Workspace - is for Testing and Trading Algos.

    By the way - for me - the "Intrabarordergeneration" - is very important, providing you Code with that in mind. Also - the "Bar Magnifier" is important and it works great - providing it is Set Correctly. Having said that - there are some things about MC - that I would like to see fixed - or added - but it is what it is - and it works great for me.

    -------------------------------------------------
    -------------------------------------------------

    Contact me with a Private Message in ET - will give some help - NO CHARGE. Each School day - I go to get the younger grandson - on the bus - to make sure he is safe. I drive 25 to 30 miles round trip - depending on which way I go - due to traffic early in the morning. I usually get home before 9:30 am - West Coast time. If you want - I will let you watch the Algo Signals - in Real Time.

    Wish you and other traders - all the best with trading.
     
    #45     Oct 20, 2022
    MarkBrown likes this.
  6. Sounds great ! How to subscribe ?
     
    #46     Oct 20, 2022
    MarkBrown likes this.
  7. Please get a sign-in for MC Project Management and submit some enhancement requests. I do it all of the time. You must have a special login id....so ask tech support for one.
     
    #47     Oct 20, 2022
    MarkBrown likes this.
  8. MarkBrown

    MarkBrown

    so i made a exit system that will automate the risk and reward for a manually entered trade.

    it works well until you add on to the position then it freaks out. m

    i called it: Stops Test 1




    [intrabarordergeneration = true];
    [RecoverDrawings = false];

    DEFINEDLLFUNC: "kernel32.dll", int, "GetTickCount";

    // Existing issues - inaccurately sync order's prices:
    // 1) entry prices - only in pyramiding mode
    // 2) exit prices - always (used close price as close position price)

    Input :
    TimeOutMS(250), // time spent since BrokerMarketPosition changed and we start correct position
    LatencyMS(500); // time spent since we start correct StrategyMarketPosition and return to monitoring mode

    variables:
    textID( text_new_s(d, time_s, c,"CurrentState") ),
    intrabarpersist sync_state("MP is synchronized!"),
    intrabarpersist diff_state("MP syncronization. Wait "),

    _rightest(0),
    _highest(0),

    inner_mp(0),
    broker_mp(0),

    intrabarpersist mp_diff(false),
    intrabarpersist mp_diff_time_start(0),

    intrabarpersist mp_corrected(false),
    intrabarpersist mp_corrected_time_start(0),

    intrabarpersist place_correction_marketorder(false),

    intrabarpersist _get_tick_count(0),
    intrabarpersist _exit_price(0),

    correct_contracts(0),
    is_buy(false),
    is_entry(true);


    if getappinfo(airealtimecalc) = 1 and getappinfo(aistrategyauto) = 1 then begin

    once begin
    print( text_setstyle(textID, 1, 0) );
    diff_state += text(TimeOutMS*.001, " seconds.");
    end;

    inner_mp = currentcontracts*marketposition;
    broker_mp = MarketPosition_at_Broker;

    _rightest = getappinfo(airightdispdatetime);
    _highest = getappinfo(aihighestdispvalue);

    text_setlocation_s(
    textID,
    juliantodate(_rightest),
    datetime2eltime_s(_rightest),
    _highest
    );

    if broker_mp <> inner_mp then begin


    _get_tick_count = GetTickCount ;

    // market position differs state
    if not mp_diff and not mp_corrected then begin
    mp_diff = true;
    mp_diff_time_start = _get_tick_count ;
    text_setstring(textID, diff_state);
    end;

    // enter correction state after TimeOut
    if mp_diff and not mp_corrected then begin
    _exit_price = c; // assume that position can closed at close price
    if _get_tick_count - mp_diff_time_start > TimeOutMS then begin
    place_correction_marketorder = true ;
    mp_corrected = true ;
    mp_corrected_time_start = _get_tick_count ;
    end;
    end;

    // correction state
    if mp_corrected then begin
    if _get_tick_count - mp_corrected_time_start > LatencyMS then begin
    mp_corrected_time_start = _get_tick_count ;
    mp_diff = false;
    mp_corrected = false;
    end;
    end;

    // place correction order
    if place_correction_marketorder then begin
    place_correction_marketorder = false ;
    if 0 <> broker_mp then _exit_price = AvgEntryPrice_at_Broker;
    ChangeMarketPosition(broker_mp - inner_mp, _exit_price, "Sync Order");
    end;

    end
    else begin
    text_setstring(textID, sync_state);
    mp_corrected = false ;
    mp_diff = false;
    end;

    end; // is real time and strategy auto


    /////////////////////////////// below code for bracket trading ////////////////////////////


    //Exit

    input:los(20),pft(20);

    if marketposition=1 then begin

    setstoploss_pt(los);

    setprofittarget_pt(pft);

    end;

    if marketposition=-1 then begin

    setstoploss_pt(los);

    setprofittarget_pt(pft);

    end;
     
    #48     Oct 28, 2022
  9. Mark - did you trace the code using PRINT statements ?
    "freaks out" - exactly what was the behavior ?
     
    #49     Oct 28, 2022
  10. MarkBrown

    MarkBrown

    so it's not handling any orders beyond a 1 lot - says order type or something invalid.
     
    #50     Oct 28, 2022