Simple problem I am sure the great minds will fix in a couple of mins
Results 1 to 3 of 33

Thread: Simple problem I am sure the great minds will fix in a couple of mins

  1. #1
    Hello hope you can assist

    Hi all I am trying something out on the bob scalper technique. I am trying to put together and ea I have two current issues
    1) I Wish to stop the ea to get a pair if the stoploss is hit
    I'm setting the stoploss to the Daily Pivot (variable - DP), I have the DP value set in International Varibles and am pulling this value to the ea fine (I display it on the chart via display message) but utilizing this code does not Appear to function to set the stop loss when a transaction is triggered

    'double stop = NormalizeDouble(DP,Digits);

    bool result = SendSingleTrade(OP_BUY, TradeComment, Lot, Ask, cease, take);
    Trade has been sent but with sl 00000'

    2) I have again a variable vsacode that I pulldown from globalvariables the number is either a number between 0-8, 9-22 or a no sign value 2147483647

    I am trying to us a simple if statement to provide sign (signal1) for the ea

    code is

    double vsacode=GlobalVariableGet(Symbol() vsacode);

    int signal1;
    if (vsacode lt; 9)signal1 = 1;
    if (vsacode gt;8)signal1 =2;
    if (vsacode gt;30)signal1=vsacode;

    Again for affirmation I am showing the value in the chart value vsacode and signal 1

    What I get is vsacode values correct ie either a number from 0-8, 9-22 or 2147483647
    but the sign 1 value is either 0 or 2147483647


    Help please

  2. #2
    Seems to me your value comparison isn't right from the 2nd part of your question....
    Quote Originally Posted by ;
    int signal1;
    if (vsacode lt; 9)signal1 = 1;
    if (vsacode gt;8)signal1 =2;
    if (vsacode gt;30)signal1=vsacode;
    You might try this manner
    if if (vsacode lt;= 8)signal1 = 2; // less or equal 8
    if (vsacode gt;=9 vsacode lt;=22)signal1 =1; // greater or equal 9 AND equal or less than 22
    if (vsacode gt;30)signal1=vsacode;

    From your code it Isn't clear to me which signal value goes with which range, so please adjust as essential

    Dont have your whole code so cant test...

    Mop

  3. #3
    Quote Originally Posted by ;
    Hi hope you can help

    Hi all I am trying out something on the bob scalper method. I am trying to put together and ea I have 2 current problems
    1) I want to stop the ea for a pair if the stoploss is hit
    I'm setting the stoploss into the Daily Pivot (changeable - DP), I've the DP value set in Global Varibles and'm pulling this value to the ea fine (I display it on the chart via display message) but using this code does not appear to work to set the stop loss when a transaction is triggered

    'double stop = NormalizeDouble(DP,Digits);

    bool result = SendSingleTrade(OP_BUY,...
    Hi censura,
    Had a quick look and it seems that you are the assigning the variable stop, together with all the DP price amount.
    You are using the identical variable as SL from the SendSingleTrade statement.
    Therefore, I think you want to find the difference between entrance and DP and use the pip value from the Order command.
    Hope that will help fix the Issue,
    EP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.