Announcement

Collapse
No announcement yet.

Stuck on Compile for Indicator.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stuck on Compile for Indicator.

    The bold big letter is were its not compling(Inputs, (Date>Date), Delta=Close, how do I fix?


    // V2 beta by SP for RTH Session Charts

    // Numbers Bars for Volume Breakdown Ask vs Bid

    // Open a Volume Delta or Regular Chart as data 1

    // Open a Cumulative Delta as data2, same Resolution as data 1, Breakdown by Ask Traded vs Bid Traded, Break on Session checked

    // Needs one date change (d<>d[1]) to reset, so data range 4 days back should work -- double check christmas and new years holidays



    // Properties: Base the study on data 2 - Cumulative Delta, Update on every tick checked, Skip identical ticks unchecked


    Inputs

    PlotOnlyToday ( true ), // Plot only today to reduce text drawing

    SessStart ( sess1starttime ),

    SessEndtime ( sess1endtime ),

    UseDelay ( true ), // Avoid to draw the text every tick in fast markets, only draw every Seconds.Delay seconds

    Seconds.Delay ( 1 ),

    DataNum ( 2 ), // data 2 - Cumulative Delta

    TextSize ( 8 ),

    TextSpace ( 7 ),

    TextFont ( " Consolas"),

    Row1.Text ( " Delta "),

    Row2.Text ( " Ask "),

    Row3.Text ( " Bid "),

    Row4.Text ( " Delta % "),

    Row5.Text ( " Tot Del "),

    Row6.Text ( " Bar Vol "),

    Row7.Text ( " Tot Vol "),

    UpColor ( RGB(0,64,0)),

    WeakUpColor ( RGB(128,255,128)),

    DnColor ( RGB(128,0,0)),

    WeakDnColor ( RGB(255,128,128)),

    NeutralColor ( white ),

    ColorLength ( 30 );





    Variables:

    TotalDelta (0),

    TotalVol (0),

    intrabarpersist Delay (0),

    HighestHi (0),

    LowestLo (0),

    DELTA (0),

    MyAskTraded (0),

    MyBidTraded (0),



    DELTAText (""),

    DELTA_Text (0),

    DeltaColor (0),



    RTDELTAText (""),

    RTDELTA_Text (0),

    RTDeltaColor (0),

    BarsSinceLastReset ( 0 );





    Once

    begin

    RTDELTA_Text = text_new_self_S (DATE, Time_S, 0, "") ;

    text_SetColor (RTDELTA_Text, black ) ;

    text_setsize (RTDELTA_Text, TextSize);

    text_setborder (RTDELTA_Text, true);

    Text_Setbgcolor (RTDELTA_Text, DeltaColor );

    text_SetStyle (RTDELTA_Text, 2, 2) ;

    text_setfontname (RTDELTA_Text, TextFont );

    Text_SetAttribute (RTDELTA_Text,1,True);

    end;



    if (DATE > DATE[1]) OR TIME[1] = SessEndtime then

    begin

    TotalDelta = 0 ;

    TotalVol = 0 ;

    HighestHi = 0;

    LowestLo = 0;

    BarsSinceLastReset = 0;

    end ;





    if time >= SessStart and time <= SessEndtime then

    begin

    If BarsSinceLastReset = 0 then

    DELTA = Close

    else

    DELTA = Close - Close[1];



    TotalDelta = Close;



    TotalVol = TotalVol+TICKS ;

    if High > HighestHi then highesthi = High;

    if Low < LowestLo then LowestLo = Low;



    BarsSinceLastReset = BarsSinceLastReset + 1;





    //We need the Volume traded at bid and at Ask

    // !! Dont use Upticks/Downticks (beta2), we need extra calculation as follows:



    If DELTA > 0 then

    begin

    MyAskTraded = (Ticks-DELTA)/2 + DELTA;

    MyBidTraded = (Ticks-DELTA)/2 ;

    end

    else If DELTA < 0 then

    begin

    MyAskTraded = (Ticks+DELTA)/2 ;

    MyBidTraded = (Ticks+DELTA)/2 - DELTA;

    end

    else If DELTA = 0 then

    begin

    MyAskTraded = (Ticks)/2 ;

    MyBidTraded = (Ticks)/2 ;

    end ;

    end ;







    if (PlotOnlyToday = false or (PlotOnlyToday = true and date=LastCalcDate )) and barstatus (DataNum) = 2 then

    begin



    DELTAText = NumToStr ( DELTA, 0);

    DELTA_Text = text_new_self_S (DATE, Time_S, 0, "") ;

    if TIME >= SessStart then

    Text_SetString (DELTA_Text,

    //newline+

    Spaces(TextSpace - StrLen(DELTAText))+DELTAText+spaces (1) +newline+

    Spaces(TextSpace - StrLen(NumToStr ( MyAskTraded , 0)))+NumToStr ( MyAskTraded , 0) +newline+

    Spaces(TextSpace - StrLen(NumToStr ( MyBidTraded , 0)))+NumToStr ( MyBidTraded , 0) +newline+

    Spaces(TextSpace - StrLen(NumToStr ( ((DELTA) /TICKS ) *100, 1))-1)+NumToStr ( ((DELTA) /TICKS ) *100, 1) +"% "+newline+

    Spaces(TextSpace - StrLen(NumToStr ( TotalDelta, 0)))+NumToStr ( TotalDelta, 0) +newline+

    //Spaces(TextSpace - StrLen(NumToStr ( highesthi , 0)))+NumToStr ( highesthi , 0) +newline+

    //Spaces(TextSpace - StrLen(NumToStr ( lowestlo, 0)))+NumToStr ( lowestlo, 0) +newline+

    Spaces(TextSpace - StrLen(NumToStr ( ticks , 0)))+NumToStr ( ticks , 0) +newline+

    Spaces(TextSpace - StrLen(NumToStr ( TotalVol, 0)))+NumToStr ( TotalVol, 0) );

    if DELTA > 0 then

    DeltaColor = gradientcolor ( DELTA , 0 , Highest (DELTA, MaxList( Barssincelastreset, ColorLength) ), WeakUpColor,UpColor) else

    if DELTA < 0 then

    DeltaColor = gradientcolor ( DELTA , Lowest (DELTA, MaxList( Barssincelastreset, ColorLength)) , 0 , DnColor,WeakDnColor) else

    DeltaColor = NeutralColor ;





    text_SetColor (DELTA_Text, black ) ;

    text_setsize (DELTA_Text, TextSize);

    text_setborder (DELTA_Text, true);

    Text_Setbgcolor (DELTA_Text, DeltaColor );

    text_SetStyle (DELTA_Text, 2, 2) ;

    text_setfontname (DELTA_Text, TextFont );

    Text_SetAttribute (DELTA_Text,1,True);





    end; //if (PlotOnlyToday = false or (PlotOnlyToday = true and date=LastCalcDate ))



    If ( (UseDelay = true and ComputerDateTime > Delay ) or UseDelay = false ) or barstatus(Datanum)=2 or barstatus(Datanum)=0 then

    begin

    if LastBarOnChart_s then

    begin

    RTDELTAText = NumToStr ( DELTA, 0);



    if TIME >= SessStart then

    Text_SetString (RTDELTA_Text,

    //newline+

    Spaces(TextSpace - StrLen(RTDELTAText))+RTDELTAText +Row1.Text+newline+

    Spaces(TextSpace - StrLen(NumToStr ( MyAskTraded , 0)))+NumToStr ( MyAskTraded , 0) +Row2.Text+newline+

    Spaces(TextSpace - StrLen(NumToStr ( MyBidTraded , 0)))+NumToStr ( MyBidTraded , 0) +Row3.Text+newline+

    Spaces(TextSpace - StrLen(NumToStr ( ((DELTA) /TICKS ) *100, 1))-1)+NumToStr ( ((DELTA) /TICKS ) *100, 1) +"%"+Row4.Text+newline+

    Spaces(TextSpace - StrLen(NumToStr ( TotalDelta, 0)))+NumToStr ( TotalDelta, 0) +Row5.Text+newline+

    Spaces(TextSpace - StrLen(NumToStr ( ticks , 0)))+NumToStr ( ticks , 0) +Row6.Text+newline+

    Spaces(TextSpace - StrLen(NumToStr ( TotalVol, 0)))+NumToStr ( TotalVol, 0) +Row7.Text);



    if DELTA > 0 then

    RTDeltaColor = gradientcolor ( DELTA , 0 , Highest (DELTA, MaxList( Barssincelastreset, ColorLength) ), WeakUpColor,UpColor) else

    if DELTA < 0 then

    RTDeltaColor = gradientcolor ( DELTA , Lowest (DELTA, MaxList( Barssincelastreset, ColorLength)) , 0 , DnColor,WeakDnColor) else

    RTDeltaColor = NeutralColor ;



    text_SetColor (RTDELTA_Text, black ) ;

    text_setsize (RTDELTA_Text, TextSize);

    text_setborder (RTDELTA_Text, true);

    Text_Setbgcolor (RTDELTA_Text, RTDeltaColor );

    text_SetStyle (RTDELTA_Text, 0, 2) ;

    text_setfontname (RTDELTA_Text, TextFont );

    Text_SetAttribute (RTDELTA_Text,1,True);

    Text_SetLocation_s (RTDELTA_Text, d, time_s, 0);

    end;



    Delay = ComputerDateTime+(Seconds.Delay*0.0000115740) ;

    end;


  • #2
    Please contact us we will direct you to Multicharts Support https://www.ampfutures.com/contact-us/

    Comment

    Disclaimer: There is a risk of loss in trading futures, forex and options. Futures, forex and options trading are not appropriate for all investors. Only risk capital should be used when trading futures. All information is for educational use only and is not investment advice. Past performance is not indicative of future results.

    This website is hosted and operated by AMP Global Clearing, LLC ("AMP"), which provides brokerage services to traders of futures and foreign exchange products. This website is intended for customer support, educational and informational purposes only and should NOT be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by AMP and the information made available on this Web site is NOT an offer or solicitation of any kind. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of AMP.

    All Users and Contributors along with their websites, products and services, are independent persons or companies that are in no manner affiliated with AMP. AMP is not responsible for, do not approve, recommend or endorse any User and/or Contributor Content referenced on this website and it’s your sole responsibility to evaluate All Content. Please be aware that any performance information provided by a user and/or contributor should be considered hypothetical.

    HYPOTHETICAL PERFORMANCE RESULTS HAVE MANY INHERENT LIMITATIONS, SOME OF WHICH ARE DESCRIBED BELOW. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. IN FACT, THERE ARE FREQUENTLY SHARP DIFFERENCES BETWEEN HYPOTHETICAL PERFORMANCE RESULTS AND THE ACTUAL RESULTS SUBSEQUENTLY ACHIEVED BY ANY PARTICULAR TRADING PROGRAM.

    ONE OF THE LIMITATIONS OF HYPOTHETICAL PERFORMANCE RESULTS IS THAT THEY ARE GENERALLY PREPARED WITH THE BENEFIT OF HINDSIGHT. IN ADDITION, HYPOTHETICAL TRADING DOES NOT INVOLVE FINANCIAL RISK, AND NO HYPOTHETICAL TRADING RECORD CAN COMPLETELY ACCOUNT FOR THE IMPACT OF FINANCIAL RISK IN ACTUAL TRADING. FOR EXAMPLE, THE ABILITY TO WITHSTAND LOSSES OR TO ADHERE TO A PARTICULAR TRADING PROGRAM IN SPITE OF TRADING LOSSES ARE MATERIAL POINTS WHICH CAN ALSO ADVERSELY AFFECT ACTUAL TRADING RESULTS. THERE ARE NUMEROUS OTHER FACTORS RELATED TO THE MARKETS IN GENERAL OR TO THE IMPLEMENTATION OF ANY SPECIFIC TRADING PROGRAM WHICH CANNOT BE FULLY ACCOUNTED FOR IN THE PREPARATION OF HYPOTHETICAL PERFORMANCE RESULTS AND ALL OF WHICH CAN ADVERSELY AFFECT ACTUAL TRADING RESULTS.

    AMP has NOT endorsed or recommended the use any product, services offered by any 3rd party User or Contributor on this forum. No person employed by, or associated with, AMP is authorized to provide any information about any 3rd party User or Contributor content. All specific brokerage related questions should be directed towards AMP.

    Copyright © 2017. All rights reserved.

    Working...
    X