Negative dollar profit from profitable trades? - page 2

 
roman.zouev: r, so if swaps are modeled, where does MT4 get this info from? 
From the last broker value, just like it does with spread=current.
 
whroeder1:
From the last broker value, just like it does with spread=current.

whroeder1,

but I am not connected to a broker.... 

 

Don't argue - just bring all the mentioned variables on the chart with comment and I guess you'll see!

You can use a simple indicator for that if you don't have access to the code.

 
Carl Schreiber:

Don't argue - just bring all the mentioned variables on the chart with comment and I guess you'll see!

You can use a simple indicator for that if you don't have access to the code.

Carl,

 

Sorry, I didn't want to come off as argumentative.  Just not sure what you meant.

I have attached my EA file, if that helps... 

Files:
 

Just add right at the beginning of start():

Comment("\nSpread:        ",DoubleToString((Ask-Bid)/_Point,0)," in Points,"
        "\nSwapLong:  ",DoubleToString(MODE_SWAPLONG,2)," per Lot,"
        "\nSwapShort: ",DoubleToString(MODE_SWAPSHORT,2)," per Lot");

 
Carl Schreiber:

Just add right at the beginning of start():

Comment("\nSpread:        ",DoubleToString((Ask-Bid)/_Point,0)," in Points,"
        "\nSwapLong:  ",DoubleToString(MODE_SWAPLONG,2)," per Lot,"
        "\nSwapShort: ",DoubleToString(MODE_SWAPSHORT,2)," per Lot");

Thanks Carl, I will try that.

I'm running a test at the moment that will take another two days. But will add this to code after and report back.

Thanks for your input! 

 
roman.zouev:

Thanks Carl, I will try that.

I'm running a test at the moment that will take another two days. But will add this to code after and report back.

Thanks for your input! 

Bear in mid you'll see it only in "Visual Mode"!!
 
Carl Schreiber:

Just add right at the beginning of start():

Comment("\nSpread:        ",DoubleToString((Ask-Bid)/_Point,0)," in Points,"
        "\nSwapLong:  ",DoubleToString(MODE_SWAPLONG,2)," per Lot,"
        "\nSwapShort: ",DoubleToString(MODE_SWAPSHORT,2)," per Lot");

That should be


   Comment("\nSpread:        ",DoubleToString((Ask-Bid)/_Point,0)," in Points,"
        "\nSwapLong:  ",DoubleToString(MarketInfo(Symbol(),MODE_SWAPLONG),2)," per Lot,"
        "\nSwapShort: ",DoubleToString(MarketInfo(Symbol(),MODE_SWAPSHORT),2)," per Lot");
.
 
Keith Watford:

That should be


   Comment("\nSpread:        ",DoubleToString((Ask-Bid)/_Point,0)," in Points,"
        "\nSwapLong:  ",DoubleToString(MarketInfo(Symbol(),MODE_SWAPLONG),2)," per Lot,"
        "\nSwapShort: ",DoubleToString(MarketInfo(Symbol(),MODE_SWAPSHORT),2)," per Lot");
.

Or to use the newer syntax:

SymbolInfoDouble(Symbol(),SYMBOL_SWAP_LONG)
SymbolInfoDouble(Symbol(),SYMBOL_SWAP_SHORT)


 

 
honest_knave:

Or to use the newer syntax:

SymbolInfoDouble(Symbol(),SYMBOL_SWAP_LONG)
SymbolInfoDouble(Symbol(),SYMBOL_SWAP_SHORT)


 

Hi,

 

my backtest is still in progress, so I haven't had a chance to add the recommended script in.  However, I had a search through the existing script in Metaeditor, and there is no mention of "swap" anywhere in the code...  Does that mean that the EA does not take any kind of swap into consideration?